title: Laravel Capsule: Catch PDOException
body: <p>I'm building a gateway to enable several instances of an application to communicate with each other. To connect to the different databases I'm using Laravel's Capsule.</p>
  <p>When the request on a database fails I would like to log the error however for some reason I am unable to catch the exception properly. Looking at the logs the catch is working however after that the application is still dying.</p>
  <p>The code is pretty basic:</p>
  <pre><code>try {
      // connection and request here
  } catch (PDOException $e) {
      Log::error('*************************************************************************');
      Log::error('Failure reading franchise BDCs');
      Log::error('Franchise: '.json_encode($franchise-&gt;site_url));
      Log::error('*************************************************************************');
  }
  </code></pre>
  <p>In the logs I have the following:</p>
  <blockquote>
  <p>[2015-04-29 09:46:35] production.INFO: Started reading PPFD [] []</p>
  <p>[2015-04-29 09:46:35] production.ERROR:</p>
  <p>************************************************************************* [] []</p>
  <p>[2015-04-29 09:46:35] production.ERROR: Failure reading franchise BDCs [] []</p>
  <p>[2015-04-29 09:46:35] production.ERROR: Franchise: &quot;https://ppfd.domain.net/&quot; [] []</p>
  <p>[2015-04-29 09:46:35] production.ERROR:</p>
  <p>************************************************************************* [] []</p>
  <p>[2015-04-29 09:46:35] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'test'@'pp.damain.net' (using password: YES)' in /var/www/fd/releases/20150423164018/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47</p>
  <p>Stack trace:</p>
  </blockquote>
  <p>How can I catch this exception and allow the code to carry on instead of crashing?</p>
  <p>Thanks in advance. Any help is appreciated.</p>