public function exceptionHandler(\Throwable $error)
    {
        $reflection = new \ReflectionClass($error);
        $registeredException = $this->findRegisteredExceptions($reflection);
        if (!is_null($registeredException)) {
            $registeredException($error);
        }
    }
public function exceptionHandler(\Throwable $error)
    {
        $reflection = new \ReflectionClass($error);
        $registeredException = $this->findRegisteredExceptions($reflection);
        if (!is_null($registeredException)) {
            $registeredException($error);
        }
    }
public function exceptionHandler ( \ Throwable $ error ) { $ reflection = new \ ReflectionClass ( $ error ) ; $ registeredException = $ this -> findRegisteredExceptions ( $ reflection ) ; if ( ! is_null ( $ registeredException ) ) { $ registeredException ( $ error ) ; } }
When an exception is thrown, this method catches it and tries to find
the best user defined callback as a response. If there is no direct
callback associated, it will tries to find a definition within the
Exception class hierarchy. If nothing is found, the default behavior is
to die the script. Should not be called manually. Used as a registered
PHP handler.

@param \Throwable $error
@throws \Throwable
When an exception is thrown this method catches it and tries to find the best user defined callback as a response . If there is no direct callback associated it will tries to find a definition within the Exception class hierarchy . If nothing is found the default behavior is to die the script . Should not be called manually . Used as a registered PHP handler .