Iβm not sure that we will recover.
Other answers describe whether or not to exclude an exception regarding environment settings.
The answer is simple: Exceptions should be thrown always, and not in relation to the environment.
If you need to, you can handle them differently, but you should avoid conditional exceptions.
There are many ways you can configure error handling in your application:
- ini settings in apache or
.htaccess config - using the same settings through php functions (e.g.
error_reporting() ) - setting up your front controller (using
application.ini or getting an instance of the front controller in Bootstrap ) - update default error handler ZF
- create your own error handler
The easiest way is application.ini :
phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.throwExceptions = 1 resources.frontController.params.displayExceptions = 1
In the application.ini development section, you can use zeros if necessary.
I recommend using the Log Application resource to handle exceptions in the production environment.
source share