title: Catch "PDOException" with custom exception handler
body: <p>I have a simple piece of code, using PDO in PHP:</p>
  
  <pre><code>$conn = new PDO('mysql:host=localhost;dbname=someDatabase', $username, $password, 
          array(
          PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION,
          PDO::ATTR_PERSISTENT =&gt; false,
      ));
  </code></pre>
  
  <p>and this custom exception handler:</p>
  
  <pre><code>function my_exceptionHandler($exception) {
      echo "Exception: {$exception-&gt;getMessage()}";
  }
  set_exception_handler("my_exceptionHandler");
  </code></pre>
  
  <p>Although the custom exception handler catches all the other exceptions, but it fails to catch the PDO-exceptions i.e. when the username and password for database are incorrect, and I just get the plain error:</p>
  
  <pre><code>SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) 
  </code></pre>
  
  <p>Is there anything I miss like a overloading custom exception handler function for this type of exceptions?
  <strong>And note that when I wrapped the PDO code in try and catch block, it worked fine but I want to catch it in my custom exception handler.</strong></p>