Skip to content
Permalink
Browse files

Remove error handler (converter, really). In practice, all it achieve…

…d was making symfony-style deprecation errors more inconvenient (they should be handled with symfony/phpunit-bridge instead)
  • Loading branch information
flack committed Dec 14, 2019
1 parent 9a12dd8 commit 66966109e72bea6e3daca32e6dcb617f7ce3be78
Showing with 0 additions and 15 deletions.
  1. +0 −15 lib/errors.php
@@ -39,7 +39,6 @@ public static function register(HttpKernel $kernel)
if (!defined('OPENPSA2_UNITTEST_RUN')) {
$handler = new self;
$handler->set_kernel($kernel);
set_error_handler([$handler, 'handle_error'], E_ALL ^ (E_NOTICE | E_WARNING));
set_exception_handler([$handler, 'handle_exception']);
}
}
@@ -65,20 +64,6 @@ public function handle_exception($error)
}
}

/**
* Catch a PHP error and turn it into an Exception to unify error handling
*/
public function handle_error($errno, $errstr, $errfile, $errline, $errcontext)
{
$msg = "PHP Error: {$errstr} \n in {$errfile} line {$errline}";
if (!empty($errcontext)) {
debug_print_r('Error context', $errcontext);
}

// PONDER: use throw new ErrorException($errstr, 0, $errno, $errfile, $errline); instead?
throw new midcom_error($msg, $errno);
}

/**
* Render an error response.
*

0 comments on commit 6696610

Please sign in to comment.
You can’t perform that action at this time.