Search code examples
zend-frameworkdispatcherfront-controller

how can redirect after a dispatcher exception?


On zend framework inside my bootstrap file i have the following code:

$frontController = Zend_Controller_Front::getInstance(); 

try 
{
    $front->dispatch();
} 
catch (Exception $e) 
{
    echo "Something wrong happen";
}

Instead the ugly message i want to redirect to a custom controller... how can i do that if i can not use $frontController to redirect .... ?

Thanks for your help..


Solution

  • Zend will redirect to ErrorController if it is set.

    By default, Zend_Controller_Plugin_ErrorHandler will forward to ErrorController::errorAction()

    See Section 12.10.5.2.