![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/middlewares/ |
<?php namespace Mautic\Middleware; use Mautic\CoreBundle\ErrorHandler\ErrorHandler; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\HttpKernelInterface; class CatchExceptionMiddleware implements HttpKernelInterface, PrioritizedMiddlewareInterface { public const PRIORITY = 100; /** * @var HttpKernelInterface */ protected $app; public function __construct(HttpKernelInterface $app) { $this->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; } }