Zend Framework

Backward incompatible change in rev 19661

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.7
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Controller
  • Labels:
    None

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).

Issue Links

Activity

Hide
Nicolas Grevet added a comment -

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.

Show
Nicolas Grevet added a comment - 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.
Hide
Matthew Weier O'Phinney added a comment -

Resolved in trunk.

Show
Matthew Weier O'Phinney added a comment - Resolved in trunk.
Hide
Emil Ivanov added a comment -

The same pattern is used in Zend_Controller_Dispatcher_Standard, line 301. Can that be fixed as well? (r19833 fixed only Zend_Controller_Front)

Show
Emil Ivanov added a comment - The same pattern is used in Zend_Controller_Dispatcher_Standard, line 301. Can that be fixed as well? (r19833 fixed only Zend_Controller_Front)
Hide
Matthew Weier O'Phinney added a comment -

Opening due to user reports

Show
Matthew Weier O'Phinney added a comment - Opening due to user reports
Hide
Matthew Weier O'Phinney added a comment -

Fixed in r20244 in trunk.

Show
Matthew Weier O'Phinney added a comment - Fixed in r20244 in trunk.
Hide
Emil Ivanov added a comment -

The same thing is happening in various places in Zend_Controller_Plugin_Broker as well.

Show
Emil Ivanov added a comment - The same thing is happening in various places in Zend_Controller_Plugin_Broker as well.
Hide
Matthew Weier O'Phinney added a comment -

Verified; will remove those wrapped exceptions shortly.

Show
Matthew Weier O'Phinney added a comment - Verified; will remove those wrapped exceptions shortly.
Hide
Matthew Weier O'Phinney added a comment -

Plugin broker no longer wraps re-thrown exceptions in trunk.

Show
Matthew Weier O'Phinney added a comment - Plugin broker no longer wraps re-thrown exceptions in trunk.
Hide
Emil Ivanov added a comment -

Everything seems fine now. Thank you!

Show
Emil Ivanov added a comment - Everything seems fine now. Thank you!

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: