Zend\Stratigility\FinalHandler::triggerError PHP Method

triggerError() private method

If no onerror option is present, or if it is not callable, does nothing. If the request is not an Http\Request, casts it to one prior to invoking the error handler. If the response is not an Http\Response, casts it to one prior to invoking the error handler.
private triggerError ( mixed $error, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
$error mixed
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
    private function triggerError($error, RequestInterface $request, ResponseInterface $response)
    {
        if (!isset($this->options['onerror']) || !is_callable($this->options['onerror'])) {
            return;
        }
        $onError = $this->options['onerror'];
        $onError($error, $request instanceof Http\Request ? $request : new Http\Request($request), $response instanceof Http\Response ? $response : new Http\Response($response));
    }