ZF-3245: Refractor try/catch in Zend_Controller_Front to keep exception stack trace
Description
Symptom: When an exception occurs during development, we see the exception class and message being rethrown from dispatch(); however, the stack trace, which can prove very useful is lost.
Because php does not have a "rethrow" feature that preserves the exception, we should either refractor to not catch exceptions while throwExceptions() is enabled or wrap the original exception to preserve the stack trace.
Comments
Posted by Wil Sinclair (wil) on 2008-06-09T12:18:35.000+0000
Please evaluate and fix/categorize as necessary.
Posted by Benjamin Eberlei (beberlei) on 2008-09-25T01:23:18.000+0000
You can still access the complete stack trace, its just not shown when you keep the exception uncatched. Try the following to get the location:
try { $front = Zend_Controller_Front::getInstance(); $front->throwExceptions(true); $front->dispatch(); } catch(Exception $e) { if($env == "development") { echo $e->getMessage(); print_r($e->getTrace()); } }