-- amar4kintu <[EMAIL PROTECTED]> wrote
(on Tuesday, 02 December 2008, 01:48 AM -0800):
> Following is my bootstrap code
> ================================
> $frontController = Zend_Controller_Front::getInstance();
> 
> $frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler());
> $frontController->throwExceptions(true);

The second directive above cancels out the first. If throwExceptions is
on, the ErrorHandler bails early.

> try {
>     $frontController->dispatch();
> } catch (Exception $e) {
> 
>     echo  $e->getMessage();
> 
> }
> 
> ================================
> 
> How can I display $e->getMessage() using ErrorController?
> 
> I have already created ErrorController and error.phtml in my default module.
> But I am not getting how to display error messages using ErrorController.
> 
> Can anyone help me regarding this?

There is an example in both the manual and the quickstart. However, as
noted above, enabling throwExceptions cancels the ErrorHandler. Get rid
of that line, and your try/catch block, and you'll see it start to work.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to