src/Viserio/Component/Exception/Http/Handler.php
protected function getResponse(
        ?ServerRequestInterface $request,
        Throwable $exception,
        Throwable $transformed
    ): ResponseInterface {
        $id        = ExceptionIdentifier::identify($exception);
        $flattened = FlattenException::create($exception);
        $code      = $flattened->getStatusCode();
        $headers   = $flattened->getHeaders();

        return $this->getDisplayer(
            $request,
            $exception,
            $transformed,
            $code
        )->display($transformed, $id, $code, $headers);
    }
protected function getResponse(
        ?ServerRequestInterface $request,
        Throwable $exception,
        Throwable $transformed
    ): ResponseInterface {
        $id        = ExceptionIdentifier::identify($exception);
        $flattened = FlattenException::create($exception);
        $code      = $flattened->getStatusCode();
        $headers   = $flattened->getHeaders();

        return $this->getDisplayer(
            $request,
            $exception,
            $transformed,
            $code
        )->display($transformed, $id, $code, $headers);
    }
Create a response for the given exception.

@param null|\Psr\Http\Message\ServerRequestInterface $request
@param \Throwable                                    $exception
@param \Throwable                                    $transformed

@return \Psr\Http\Message\ResponseInterface