You are here

public function ExceptionHandler::setHandler in Zircon Profile 8

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

Sets a user exception handler.

Parameters

callable $handler An handler that will be called on Exception:

Return value

callable|null The previous exception handler if any

File

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

Class

ExceptionHandler
ExceptionHandler converts an exception to a Response object.

Namespace

Symfony\Component\Debug

Code

public function setHandler($handler) {
  if (null !== $handler && !is_callable($handler)) {
    throw new \LogicException('The exception handler must be a valid PHP callable.');
  }
  $old = $this->handler;
  $this->handler = $handler;
  return $old;
}