You are here

private function ExceptionHandler::failSafeHandle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/debug/ExceptionHandler.php \Symfony\Component\Debug\ExceptionHandler::failSafeHandle()

Sends a response for the given Exception.

If you have the Symfony HttpFoundation component installed, this method will use it to create and send the response. If not, it will fallback to plain PHP functions.

Parameters

\Exception $exception An \Exception instance:

1 call to ExceptionHandler::failSafeHandle()
ExceptionHandler::handle in vendor/symfony/debug/ExceptionHandler.php
Sends a response for the given Exception.

File

vendor/symfony/debug/ExceptionHandler.php, line 157

Class

ExceptionHandler
ExceptionHandler converts an exception to a Response object.

Namespace

Symfony\Component\Debug

Code

private function failSafeHandle(\Exception $exception) {
  if (class_exists('Symfony\\Component\\HttpFoundation\\Response', false) && __CLASS__ !== get_class($this) && ($reflector = new \ReflectionMethod($this, 'createResponse')) && __CLASS__ !== $reflector->class) {
    $response = $this
      ->createResponse($exception);
    $response
      ->sendHeaders();
    $response
      ->sendContent();
    return;
  }
  $this
    ->sendPhpResponse($exception);
}