I'm not sure if we are getting you right.
The other answers tell how whether to throw or not the Exception regarding the environment setting.
The answer is simple:
The exceptions should be thrown always, not regarding the environment.
If you need, you may handle them differently, but you should avoid conditional exceptions.
There are many ways, you may set up error handling in your app:
- ini settings in apache or
.htaccess
config
- using the same settings via php functions (e.g.
error_reporting()
)
- configuring your front controller (using
application.ini
or getting front controller instance in Bootstrap
)
- update ZF's default error handler
- create your own error handler
The simplest it seems is application.ini
:
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.throwExceptions = 1
resources.frontController.params.displayExceptions = 1
In development section of application.ini
you may use zeros where needed.
I recommend using Log Application resource to handle the exceptions on the production environment.