Closed Arcesilas closed 5 years ago
The middleware is supposed to work with any PSR-15 middleware dispatcher. Is there anything I'm doing wrong?
Yes... and no...
The Middleware\Whoops
documentation is not very clear about Whoops\Run instanciation:
Allows to provide a custom Whoops\Run instance. If it's not defined, creates an instance automatically.
Actually, a new instance is created, but no handler is set (for instance, PrettyPageHandler
).
To fix the previous example:
$whoops = (new \Whoops\Run())
->prependHandler(new \Whoops\Handler\PrettyPageHandler())
->register();
$router->middleware(new Whoops($whoops));
This may help someone...
Hi,
I'm trying to have
Whoops
work withRoute
. I'm using Middlwares\Whoops to (try to) achieve this. He're a very simple non working example (public/index.php
):When opening
http://localhost
,Hello world
is correctly displayed. When openinghttp://localhost/foo
, I've got this error message in the console (and not in the browser):The middleware is supposed to work with any PSR-15 middleware dispatcher. Is there anything I'm doing wrong?