ZF-8558: Backward incompatible change in rev 19661
Description
Let me try to explain it with some code:
Application dispatching:
$front = Zend_Controller_Front::getInstance();
try {
$front->dispatch();
} catch (My_Controller_Outcome_Result $e) {
$front->getResponse()->sendResponse();
// Ignore
}
{{My_Controller_Outcome_Result}} exceptions (thrown somewhere in actions) usually indicate a redirect (or other event that should stop the execution)
Prior to 19661 I was actually getting a {{My_Controller_Outcome_Result}} exception, but after that the instance is {{Zend_Controller_Exception}}, so the catch fails.
I managed to locate the change in ZF rev 19661 (trunk).
Comments
Posted by Nicolas Grevet (nyko18) on 2009-12-18T07:54:28.000+0000
I really hope this gets fixed soon. I don't know how we're supposed to try/catch our own code if the Zend Framework now only throws Zend_Controller_Exception for everything that's thrown out of the code.
Posted by Matthew Weier O'Phinney (matthew) on 2009-12-21T06:52:36.000+0000
Resolved in trunk.
Posted by Emil Ivanov (vladev) on 2010-01-05T03:05:21.000+0000
The same pattern is used in Zend_Controller_Dispatcher_Standard, line 301. Can that be fixed as well? (r19833 fixed only Zend_Controller_Front)
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-12T13:09:35.000+0000
Opening due to user reports
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-12T13:15:03.000+0000
Fixed in r20244 in trunk.
Posted by Emil Ivanov (vladev) on 2010-01-13T04:21:51.000+0000
The same thing is happening in various places in Zend_Controller_Plugin_Broker as well. :)
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-13T05:21:31.000+0000
Verified; will remove those wrapped exceptions shortly.
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-13T05:30:30.000+0000
Plugin broker no longer wraps re-thrown exceptions in trunk.
Posted by Emil Ivanov (vladev) on 2010-01-13T06:26:52.000+0000
Everything seems fine now. Thank you! :)