Turned errors into exceptions

This commit is contained in:
Marcin Kurczewski 2014-09-16 13:27:12 +02:00
parent 6e196637eb
commit bb7b1f3321

View file

@ -26,3 +26,14 @@ final class AutoLoader
AutoLoader::init(); AutoLoader::init();
require_once(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); require_once(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
function turnErrorsIntoExceptions()
{
set_error_handler(
function($errno, $errstr, $errfile, $errline, array $errcontext)
{
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
});
}
turnErrorsIntoExceptions();