Zend\Expressive\TemplatedErrorHandler::handleErrorResponse PHP Method

handleErrorResponse() private method

Marshals the response status from the error. If the error is not an exception, it then proxies to handleError(); otherwise, it proxies to handleException().
private handleErrorResponse ( mixed $error, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface
$error mixed
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
return Psr\Http\Message\ResponseInterface
    private function handleErrorResponse($error, Request $request, Response $response)
    {
        $response = $response->withStatus(Utils::getStatusCode($error, $response));
        if (!$error instanceof \Exception && !$error instanceof \Throwable) {
            return $this->handleError($error, $request, $response);
        }
        return $this->handleException($error, $request, $response);
    }