getParameter('exception'); $this->logger->log($exception, ILogger::EXCEPTION); // Display a generic error message to the user return new Responses\CallbackResponse(function (Http\IRequest $httpRequest, Http\IResponse $httpResponse): void { if (preg_match('#^text/html(?:;|$)#', (string) $httpResponse->getHeader('Content-Type'))) { require __DIR__ . '/500.phtml'; } }); } }