src/Leevel/Kernel/Runtime.php
public function render(IRequest $request, Exception $e): IResponse
    {
        if (method_exists($e, 'render') && $response = $e->render($request, $e)) {
            if (!($response instanceof IResponse)) {
                $response = new Response($response,
                    $this->normalizeStatusCode($e),
                    $this->normalizeHeaders($e)
                );
            }

            return $response;
        }

        $e = $this->prepareException($e);

        if ($request->isAcceptJson()) {
            return $this->makeJsonResponse($e);
        }

        return $this->makeHttpResponse($e);
    }
public function render(IRequest $request, Exception $e): IResponse
    {
        if (method_exists($e, 'render') && $response = $e->render($request, $e)) {
            if (!($response instanceof IResponse)) {
                $response = new Response($response,
                    $this->normalizeStatusCode($e),
                    $this->normalizeHeaders($e)
                );
            }

            return $response;
        }

        $e = $this->prepareException($e);

        if ($request->isAcceptJson()) {
            return $this->makeJsonResponse($e);
        }

        return $this->makeHttpResponse($e);
    }
异常渲染.

@param \Leevel\Http\IRequest $request
@param \Exception            $e

@return \Leevel\Http\IResponse