Symfony\Component\HttpKernel\HttpKernel::terminateWithException PHP Method

terminateWithException() public method

public terminateWithException ( Exception $exception )
$exception Exception
    public function terminateWithException(\Exception $exception)
    {
        if (!$request = $this->requestStack->getMasterRequest()) {
            throw new \LogicException('Request stack is empty', 0, $exception);
        }

        $response = $this->handleException($exception, $request, self::MASTER_REQUEST);

        $response->sendHeaders();
        $response->sendContent();

        $this->terminate($request, $response);
    }