Zend\Expressive\WhoopsErrorHandler::handleException PHP Méthode

handleException() protected méthode

Calls on prepareWhoopsHandler() to inject additional data tables into the generated payload, and then injects the response with the result of whoops handling the exception.
protected handleException ( Throwable $exception, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : Psr\Http\Message\ResponseInterface
$exception Throwable
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
Résultat Psr\Http\Message\ResponseInterface
    protected function handleException($exception, Request $request, Response $response)
    {
        // Push the whoops handler if any
        if ($this->whoopsHandler !== null) {
            $this->whoops->pushHandler($this->whoopsHandler);
        }
        // Walk through all handlers
        foreach ($this->whoops->getHandlers() as $handler) {
            // Add fancy data for the PrettyPageHandler
            if ($handler instanceof PrettyPageHandler) {
                $this->prepareWhoopsHandler($request, $handler);
            }
        }
        $response->getBody()->write($this->whoops->handleException($exception));
        return $response;
    }