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

Please evaluate and fix/categorize as necessary.

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()); } }