A PSR-7 compatible middleware for Whoops, the fantastic pretty error handler for PHP.
You can install the library using Composer:
composer require franzl/whoops-middleware
If you're using Zend's Stratigility middleware pipe, you need to use the special error middleware to be able to handle exceptions:
$app->pipe(new \Franzl\Middleware\Whoops\ErrorMiddleware);
(You should probably do this at the end of your middleware stack, so that errors cannot be handled elsewhere.)
Add the standard middleware to the queue:
$queue[] = new \Franzl\Middleware\Whoops\Middleware;