Sorry, dispatching works with a simple:

    $fc = $application->getBootstrap()->getResource('FrontController');
    $request = $fc->getRequest();

    $request->setParam('error_handler', $error)
            ->setModuleName('default')
            ->setControllerName('error')
            ->setActionName('error')
            ->setDispatched(false);

    $fc->dispatch($request);

But since I am raising the error in a FC Plugin the error is getting trapped again.

So is somehow OK.

Cristian
Hi,

I am trying to do this on ZF 1.12 to treat errors.

1. I am keeping set the throwexceptions to false so the Error handler plugin go into effect.

2. The issue is I may have errors not appearing because of routing not matching orerrors within actions. So I would like to treat this errors as well.

This can be done easily on index.php

try {
    $response = $application->bootstrap()->run();
} catch(Zend_Exception $error) {
    //logic in case of error
}

But instead of treating the error into index.php I would like to redispatch to same erroraction from default/Error controller.I have tried several approaches but no luck for now.


Any idea? Thanks!

Cristian

Reply via email to