-- David Mintz <[EMAIL PROTECTED]> wrote
(on Friday, 01 June 2007, 03:01 PM -0400):
> http://framework.zend.com/manual/en/zend.controller.plugins.html#
> zend.controller.plugins.standard
> 
> At "7.10.5.1.1. Using the ErrorHandler as a 404 Handler" in the
> ErrorControlller/errorAction() code examples it says
> 
> 
>        $this->_getRequest('error_handler');
> 
> but it appears that $this has no such method. The text says to use 
> __getParam()
> and that does work.

This has already been logged in JIRA -- ZF-1447. I plan to address it
before the next release.

Use this instead:

    $this->_getParam('error_handler');

> I am just trying to discover how to display some debug info in the browser for
> development, and eventually log it and display a more generic "oops" message.
> 
> This seems to work as well (with ErrorController::errorAction()):
> 
>     $exceptions = $this->getResponse()->getException();
>         $message = '';
>         foreach($exceptions as $e) {
>             $message .= $e->getMessage() . '<br/>';
>         }
>         $this->view->message = $message;
> 
> But I wonder what the relationship is between what is returned by $this->
> _getParam('error_handler') versus $this->getResponse()->getException();

The difference is that the object returned in the error_handler param
has a little more information about the type of error raised, and
contains the single exception caught that caused the error
(getException() in the response actually returns an exception stack
(array), usually a single exception, but still as an array). Otherwise,
they're basically analogous.

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

Reply via email to