How to prevent Slim from catching exceptions?

Hello,

I am using slim to build a rest api, and as such don’t normally have a web browser open making the requests to my server. Sometimes I will make a mistake that causes the server to return a general 500 error.

In the normal case I can quickly take a look at the tail of the server error logs an see what went wrong, but when slim catches all the exceptions, I get no error log entry. Then I have to open up a browser to make the request and see the error in the body of the response.

Is there a way to turn off this exception catching behavior?

Thanks!

See the disabling section at the System Error Handler docs.

unset($app->getContainer()['errorHandler']);

What version of Slim?

if its v2 theres no way since Exceptions are used internally to manage application flow.

In v3 there’s a setting to control it… if you need more information about the error, you can enable additional information via the container setting $container['setting']['displayErrorDetails'] = true;