title: Handle specific Exceptions in php
body: <p>I want to catch a specific Exception and handle it properly. However, I have not done this before and I want to do it in the best way. </p>
  
  <p>Will it be correct to create a separate class something like </p>
  
  <pre><code> class HandleException extends Exception
  {
     //my code to handle exceptions;
  }
  </code></pre>
  
  <p>and in it have different methods handling the different exception cases? As far as I understand, the Exception class is like an "integrated" class in php so it can be extended and if an Exception is caught it is not obligatory to terminate the flow of the program?</p>
  
  <p>And, an instance of this class will be created when an exception is caught? Sth. like</p>
  
  <pre><code>     catch ( \Exception $e ) {
          $error = new HandleException;
      }
  </code></pre>