You are here

public function ErrorHandler::setExceptionHandler in Zircon Profile 8

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

Sets a user exception handler.

Parameters

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

Return value

callable|null The previous exception handler

Throws

\InvalidArgumentException

File

vendor/symfony/debug/ErrorHandler.php, line 232

Class

ErrorHandler
A generic ErrorHandler for the PHP engine.

Namespace

Symfony\Component\Debug

Code

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