src/Leevel/Kernel/Kernel.php
public function handle(IRequest $request): IResponse
    {
        try {
            $this->registerBaseService($request);

            $this->bootstrap();

            $response = $this->getResponseWithRequest($request);

            $this->middlewareTerminate($request, $response);
        } catch (Exception $e) {
            $this->reportException($e);

            $response = $this->renderException($request, $e);
        } catch (Throwable $e) {
            $e = new ErrorException(
                $e->getMessage(),
                $e->getCode(),
                E_ERROR,
                $e->getFile(),
                $e->getLine(),
                $e->getPrevious()
            );

            $this->reportException($e);

            $response = $this->renderException($request, $e);
        }

        return $response;
    }
public function handle(IRequest $request): IResponse
    {
        try {
            $this->registerBaseService($request);

            $this->bootstrap();

            $response = $this->getResponseWithRequest($request);

            $this->middlewareTerminate($request, $response);
        } catch (Exception $e) {
            $this->reportException($e);

            $response = $this->renderException($request, $e);
        } catch (Throwable $e) {
            $e = new ErrorException(
                $e->getMessage(),
                $e->getCode(),
                E_ERROR,
                $e->getFile(),
                $e->getLine(),
                $e->getPrevious()
            );

            $this->reportException($e);

            $response = $this->renderException($request, $e);
        }

        return $response;
    }
响应 HTTP 请求

@param \Leevel\Http\IRequest $request

@return \Leevel\Http\IResponse