title: Combining multiple try-catch blocks into one
body: <p>Here is a sample block of code</p>
  
  <pre><code>// rebuild session state for test, need the current phase first
  String phaseName = testtaker.getPhase();
  TestPhase phase = null;
  
  try {
      phase = objFactory.getPhase(testtaker.getTestengine(), phaseName);
  } catch (Exception e) {
      log.error("Exception when getting phase for testtaker.", e);
      CaslsUtils.outputLoggingData(log_, request);
      // Toss the exception back to the engine, add a message
      throw new Exception("Cannot create phase: " + phaseName);
  }
  
  try {
      // Adding this code to improve the performance of the application during student login
      Testtaker newTestTaker = objFactory.getDataAccessor().getTesttakerByTestTakerId(testtaker.getTesttakerid());// This will populate testtaker object with all its child table records
      if(newTestTaker != null) {
          session.setAttribute(ConstantLibrary.SESSION_TESTTAKER, newTestTaker);
      }
      phase.rebuildTest(session);
  } catch (Exception e) {
      log.error("Exception when calling rebuildTest.", e);
      CaslsUtils.outputLoggingData(log_, request);
      // Toss the exception back to the engine, add a message
      throw new Exception("Cannot Rebuild Test");
  }
  </code></pre>
  
  <p>Kindly help me how to combine this code in a multi-catch statement as when I try to do it, it generates error in second catch block as unreachable code.</p>