Ejemplo n.º 1
0
 /**
  * Error, instance on (@link Zend_Controller_Plugin_ErrorHandler)
  *
  * @return void
  */
 public function errorAction()
 {
     $errors = $this->_getParam('error_handler');
     $exception = $errors->exception;
     $exceptionType = get_class($exception);
     switch ($exceptionType) {
         case 'Zend_XmlRpc_Client_FaultException':
             $error->type = self::EXCEPTION_MODEL;
             Streamwide_Web_Log::error($exception->getCode() . ':' . $exception->getMessage());
             break;
         default:
             break;
     }
     switch ($errors->type) {
         case self::EXCEPTION_MODEL:
             $this->view->message = 'XmlRpc error';
             break;
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
             // 404 error -- controller or action not found
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Page not found';
             break;
         default:
             // application error
             $this->getResponse()->setHttpResponseCode(500);
             $this->view->message = 'Application error';
             break;
     }
     $this->view->exception = $errors->exception;
     $this->view->request = $errors->request;
     if ($this->getRequest()->isXmlHttpRequest()) {
         $this->getHelper('viewRenderer')->direct('ajax');
     }
 }