ZF-2560: Zend_Controller_Action::__call() should throw different exceptions for missing actions vs missing methods

Issue Type: Improvement Created: 2008-02-04T10:52:19.000+0000 Last Updated: 2008-02-26T12:56:08.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Matthew Weier O'Phinney (matthew) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: Attachments:


Zend_Controller_Action::__call() currently doesn't differentiate between missing actions and missing methods, which can lead to false 404 errors in the ErrorController.

Consider implementing:

<pre class="highlight">
public function __call($method, $args)
    if ('Action' == substr($method, -6)) {
        throw new Zend_Controller_Action('Action does not exist', 404);
    throw new Zend_Controller_Action('Method does not exist', 500);

Error controllers could then test for the error code and/or message in order to determine the error type.


Posted by Matthew Weier O'Phinney (matthew) on 2008-02-04T11:19:52.000+0000

Committed to trunk in r7783, and backported to 1.0 branch in r7784.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.