Closed visualcookie closed 7 years ago
In this stage, the middleware only replaces the default errorHandler
container only not phpErrorHandler
. The phpErrorHandler
is for PHP7.
And if your application breaks the lifecycle of slim middleware. it will not trigger this middleware that why you cannot see the whoop error. For example, the program throws an exception and without a handle.
Update on 2017-01-18 06:39:
errorHandler
and phpErrorHandler
.global mode
to install the whoops. this mode supports the program life cycle broken.Amazing, will try that out as soon as I'm back. 👍
@zeuxisoo Edit Hum... somehow it still shows the default Slim Application Error message. Have tried to implement it as middleware aswell as trying it as global in my depenencies file. To see my file structure look here: https://github.com/visualcookie/slim-sentinel-auth/tree/version-2
Maybe you have an idea. I've not yet committed this, since it's not working, but I think you can kinda imagine what I did.
Edit 2 Have figured it out. I needed to implement it in Middleware as well as set the Global. Now works. :)
I know, when placing the Middleware call into my src/middleware.php file, it will automatically replace Slim's error message with Whoops (haven't tested yet). But sometimes, I run into trouble with PHP errors.
Is there a way to replace them with Whoops too? If so, how? Haven't found it anywhere.
EDIT: Tried the rest, to see if the Error Handler is replaced, but it's not. Doing it like so:
$app->response()->status(500);
This is my public/index.php file:
In the src/middleware.php is the Middleware call as in the Readme
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware($app));
.