Пример #1
0
 /**
  * Handles external error caused by end-users.
  * This method overrides the parent implementation.
  * It is invoked by PRADO when an external exception is thrown.
  */
 protected function handleExternalError($statusCode, $exception)
 {
     // log the error (only for BlogException)
     if ($exception instanceof BlogException) {
         Prado::log($exception->getErrorMessage(), TLogger::ERROR, 'BlogApplication');
     }
     // call parent implementation to display the error
     parent::handleExternalError($statusCode, $exception);
 }
Пример #2
0
 /**
  * Displays error to the client user.
  * THttpException and errors happened when the application is in <b>Debug</b>
  * mode will be displayed to the client user.
  * @param integer response status code
  * @param Exception exception instance
  */
 protected function handleExternalError($statusCode, $exception)
 {
     if ($exception instanceof BlogException) {
         $message = $exception->getMessage();
         Prado::log($message, TLogger::ERROR, 'BlogApplication');
         $message = urldecode($this->getApplication()->getSecurityManager()->hashData($message));
         $this->Response->redirect($this->Service->constructUrl('ErrorReport', array('msg' => $message), false));
     } else {
         parent::handleExternalError($statusCode, $exception);
     }
 }