public function ExceptionHandler::handle

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:

See also

sendPhpResponse

createResponse

File

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

Class

ExceptionHandler
ExceptionHandler converts an exception to a Response object.

Namespace

Symfony\Component\Debug

Code

public function handle(\Exception $exception) {
  if (class_exists('Symfony\\Component\\HttpFoundation\\Response')) {
    $this
      ->createResponse($exception)
      ->send();
  }
  else {
    $this
      ->sendPhpResponse($exception);
  }
}