Bolt\EventListener\NotFoundListener::renderNotFound PHP Method

renderNotFound() private method

Render a not found template.
private renderNotFound ( GetResponseForExceptionEvent $event, string $template, array $context )
$event Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent
$template string
$context array
    private function renderNotFound(GetResponseForExceptionEvent $event, $template, array $context)
    {
        try {
            $html = $this->twig->render($template, $context);
            $response = new Response($html, Response::HTTP_NOT_FOUND);
            $event->setResponse($response);
        } catch (TwigErrorRuntime $e) {
            throw new RuntimeException('Unable to render 404 page!', null, $e);
        }
    }