예제 #1
0
 public static function show_production_error(\Exception $e)
 {
     // when we're on CLI, always show the php error
     if (\Fuel::$is_cli) {
         return static::show_php_error($e);
     }
     if (!headers_sent()) {
         $protocol = \Input::server('SERVER_PROTOCOL') ? \Input::server('SERVER_PROTOCOL') : 'HTTP/1.1';
         header($protocol . ' 500 Internal Server Error');
     }
     $response = '';
     try {
         $response = \CMF::getCustomErrorResponse(\Lang::get("site.errors.http.500", array('resource' => 'page'), \Lang::get("site.errors.http.default", array('resource' => 'page'), 'Please contact the website administrator')));
     } catch (\Exception $e) {
         $response = \View::forge('errors' . DS . 'production');
     }
     exit($response);
 }
예제 #2
0
 /**
  * Tries to render the error response from a custom template, falling back to the default one
  */
 public function response()
 {
     return \CMF::getCustomErrorResponse($this->getMessage(), $this->getCode());
 }