Dealing with uncatched exceptions and using set_exception_handler() in Zend Framework
This post has NOT been accepted by the mailing list yet.
In the previous framework I used, there was a global exception handler defined in the bootstrap (using set_exception_handler()). This way, if an exception occured and was not catched, if was still possible to output something "nice", not just a blank page.
Is there an already existing way of dealing with uncatched exception in ZF?
Also, if I use my own exception handler (using set_exception_handler()), I see that there is an instance of set_exception_handler() in the constructor of Zend_Rest_Server! This is bad because it would overwrite my own exception handler if I use one! I think Zend_Rest_Server should at least use restore_exception_handler() in its destructor to restore the previous handler, if one existed.
How does ZF suggest to deal with uncatched exceptions?
This will catch all critical exceptions that may break application execution process. All other exceptions (MVC exceptions) can be cought at the dispatch process. For example you may use a front controller plugin that catches MVC exceptions and handles them accordingly.
If you wish you can even utilize a single handler class to handle both types of exceptions and perform certain actions, like for example logging exception data with Zend_Log, sending emails or just printing out.