app = $app; } public function handle(Request $request, $type = self::MAIN_REQUEST, $catch = true) { $content = 'The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator. System administrators, check server logs for errors.'; try { $response = $this->app->handle($request, $type, $catch); if ($response instanceof Response) { return $response; } } catch (\Exception $exception) { $content = ErrorHandler::getHandler()->handleException($exception, true); } return new Response($content, 500); } public function getPriority() { return self::PRIORITY; } }