I did smth like this

        public function errorAction()
        {
                $error = $this->_request->getParam('error_handler');

                switch ($error->type) {
                        case 
Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
                        case 
Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:

                                $this->getResponse()->setRawHeader('HTTP/1.1 
404 Not Found');
                                $this->view->message = 'This page is 
unavailable';
                                break;

                        default:
                                $this->getResponse()->setRawHeader('HTTP/1.1 
500 Internal Error');
                                error_log($error->exception);
                                $this->view->message = 'Internal server error';
                        }
                        break;
                }
        }


Jack Sleight wrote:
> 
> Hi,
> Does the ErrorController have any built in ability to display different 
> errors for different problems, or is there a way to access the actual 
> Exception object that was thrown? It would be nice to be able to show 
> different errors for different problems e.g. "Page not found" vs. "Uh 
> oh, something random went horribly wrong". I would also quite like to be 
> able to get it to email me the details of the error, but for this I 
> would need access to the Exception object.
> Thanks,
> -- 
> Jack
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ErrorController-abilities--tf4078717s16154.html#a11593127
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to