public function ExceptionHandler::createResponse

Creates the error Response associated with the given Exception.

Parameters

\Exception|FlattenException $exception An \Exception instance:

Return value

Response A Response instance

File

drupal/core/vendor/symfony/debug/Symfony/Component/Debug/ExceptionHandler.php, line 109

Class

ExceptionHandler
ExceptionHandler converts an exception to a Response object.

Namespace

Symfony\Component\Debug

Code

public function createResponse($exception) {
  if (!$exception instanceof FlattenException) {
    $exception = FlattenException::create($exception);
  }
  return new Response($this
    ->decorate($this
    ->getContent($exception), $this
    ->getStylesheet($exception)), $exception
    ->getStatusCode(), $exception
    ->getHeaders());
}