Tweaking error handlers in the front controller.

This commit is contained in:
Taylor Otwell 2011-07-11 07:47:54 -07:00
parent 69d1377fd4
commit f6ff5370ef
1 changed files with 5 additions and 2 deletions

View File

@ -45,13 +45,15 @@
set_exception_handler(function($e) set_exception_handler(function($e)
{ {
require_once SYS_PATH.'error'.EXT; require_once SYS_PATH.'error'.EXT;
System\Error::handle($e); System\Error::handle($e);
}); });
set_error_handler(function($number, $error, $file, $line) set_error_handler(function($number, $error, $file, $line)
{ {
require_once SYS_PATH.'error'.EXT; require_once SYS_PATH.'error'.EXT;
System\Error::handle(new ErrorException($error, 0, $number, $file, $line));
System\Error::handle(new ErrorException($error, $number, 0, $file, $line));
}); });
register_shutdown_function(function() register_shutdown_function(function()
@ -59,7 +61,8 @@
if ( ! is_null($error = error_get_last())) if ( ! is_null($error = error_get_last()))
{ {
require_once SYS_PATH.'error'.EXT; require_once SYS_PATH.'error'.EXT;
System\Error::handle(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']));
System\Error::handle(new ErrorException($error['message'], $error['type'], 0, $error['file'], $error['line']));
} }
}); });