private function tryErrorResponse(\Throwable $error, InternalRequest $ireq, Response $response, array $filters)
{
try {
$status = HTTP_STATUS["INTERNAL_SERVER_ERROR"];
$msg = $this->options->debug ? "<pre>" . htmlspecialchars($error) . "</pre>" : "<p>Something went wrong ...</p>";
$body = makeGenericBody($status, ["sub_heading" => "Requested: {$ireq->uri}", "msg" => $msg]);
$response->setStatus(HTTP_STATUS["INTERNAL_SERVER_ERROR"]);
$response->setHeader("Connection", "close");
$response->end($body);
} catch (ClientException $error) {
return;
} catch (\Throwable $error) {
if ($ireq->filterErrorFlag) {
$this->tryFilterErrorResponse($error, $ireq, $filters);
} else {
$this->logger->error($error);
$this->close($ireq->client);
}
}
}