コード例 #1
0
ファイル: ErrorHandler.php プロジェクト: railsphp/framework
 public function handle()
 {
     $status = $this->response()->status();
     $filePath = $this->getService('rails.config')['paths']['public_path']->extend($status . '.html');
     if (is_file($filePath)) {
         $body = file_get_contents($filePath);
     } else {
         $body = sprintf(Reporter::ERROR_NOTICE, $status, StatusCodes::getName($status));
     }
     $this->response()->setBody($body);
 }
コード例 #2
0
ファイル: Reporter.php プロジェクト: railsphp/framework
 protected function errorNotice($e, $status)
 {
     return sprintf(self::ERROR_NOTICE, $status, StatusCodes::getName($status));
 }