Open vaclavvanik opened 5 years ago
As in Zend\Stratigility\Middleware\ErrorHandler I added attachListener method to ExceptionHandler. Listeners are triggered when an exception is caught and provide ability to log exception.
Zend\Stratigility\Middleware\ErrorHandler
Attach listeners using ExceptionHandler::attachListener():
$exceptionHandler->attachListener(function (Throwable $throwable) use ($logger) { $message = sprintf( '[%s] %s', date('Y-m-d H:i:s'), $throwable->getMessage() ); $logger->error($message); });
Tests are added but I don't know how to test triggering listners because exception handler calls php exit. :-/
exit
As in
Zend\Stratigility\Middleware\ErrorHandler
I added attachListener method to ExceptionHandler. Listeners are triggered when an exception is caught and provide ability to log exception.Attach listeners using ExceptionHandler::attachListener():
Tests are added but I don't know how to test triggering listners because exception handler calls php
exit
. :-/