-- TravisJ <[EMAIL PROTECTED]> wrote
(on Wednesday, 23 January 2008, 02:45 PM -0800):
> Having functions that are not actions in a controller seems to result in an
> unexpected error type.
> 
> For example, if I have the protected function _protFunc() and accidentally
> call $this->_protFunk(), an EXCEPTION_NO_ACTION is generated by the
> ErrorHandler Plugin.
> 
> But EXCEPTION_NO_ACTION is specifically defined as a situation in which the
> correct controller is called but an incorrect action is called.
> 
> Is this by design?  Should users not have non-action functions inside a
> controller?  
> 
> If it should be OK to have non-action functions inside a controller, then it
> seems that EXCEPTION_OTHER should be called rather than EXCEPTION_NO_ACTION
> (which is when one would usually display a 404 type page).

Zend_Controller_Action::__call() exists to provide a mechanism whereby
you can have a default action called when the particular action doesn't
exist in the controller. By default, it simply throws an exception,
which means the action does not exist.

If you have a typo when doing a method call, it will also be intercepted
by __call(). Should there be a distinction between exceptions thrown due
to calls to action methods versus method calls? Possibly. Should you
correct your code if you have an invalid method call. Most likely.

I'll create an issue in the tracker for this, but the main point still
remains: you have an error in your code (which you already know, due to
the fact that an exception was trapped).

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to