title: error handling in codeigniter
body: <p>In my project to catch all the PHP errors I have set up my error handling mechanism as follows:</p>
  
  <ol>
  <li>I have set <code>error_reporting()</code> in <code>index.php</code> file which overrides
  anything in the <code>php.ini</code> file        </li>
  <li>An error handler is set in <code>system/codeigniter/CodeIgniter.php</code> using
  <code>set_error_handler</code> - this error handler, <code>_exception_handler</code>,  is
  found in <code>system/codeigniter/Common.php</code></li>
  <li>The <code>_exception_handler</code> function ignores <code>E_STRICT</code> errors, calls the
  <code>show_php_error</code> function From the Exceptions system library if the
  severity is that specified by your <code>error_reporting()</code> function in
  <code>index.php</code> and logs the error according to whatever you have set up in your <code>config.php</code> file</li>
  <li>The handler returns <code>FALSE</code> so after this PHP goes on to handle the
  error however it normally would according your <code>error_reporting</code> level
  and <code>display_errors</code> setting. </li>
  </ol>
  
  <p>The thing that is puzzling me is that <code>E_ERROR</code> errors i.e. fatal errors don’t seem to be being caught by <code>_exception_handler</code> at all. It’s not just that <code>show_php_error</code> isn’t being called, it looks like the function just isn’t being called for them. This is obviously a problem as it means that they aren’t get handled by <code>show_php_error</code> or logged. For example if I deliberately mistype <code>$this-&gt;load-&gt;views('foo');</code> in a controller, the handler doesn’t get called.</p>
  
  <p>Any suggestion about error handling would be much appreciated, thanks!</p>