slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

Wrong information about disabling Slim`s error handling in documentation #1915

Closed fetzi closed 7 years ago

fetzi commented 8 years ago

The section Disabling on the System Error Handler docs page suggests that you can disable slim error handling by unsetting the errorHandlerkey in the container.

To completely disable Slim’s error handling, simply remove the error handler from the container:

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

You are now responsible for handling any exceptions that occur in your application as they will not be handled by Slim.

This information is not true for PHP 7+ Throwables because they get handled by the PhpError class. If you are using PHP 7+ you have to use the following code to completely disable Slim's error handling:

unset($app->getContainer()['errorHandler']);
unset($app->getContainer()['phpErrorHandler']);
fetzi commented 7 years ago

Do you have looked into this issue?

akrabat commented 7 years ago

Fixed by https://github.com/slimphp/Slim-Website/commit/a9a41a8d242f42c8d5e498a7e6746932bb1f3e31