src/Leevel/Kernel/Runtime.php
protected function makeJsonResponse(Exception $e): IResponse
    {
        $whoops = $this->makeWhoops();
        $whoops->pushHandler($this->makeJsonResponseHandler());

        // JSON 响应结果的物理路径做安全处理
        $json = $whoops->handleException($e);
        $json = json_decode($json, true);
        $json['error']['file'] = $this->filterPhysicalPath($json['error']['file']);
        $json = json_encode($json);

        return JsonResponse::fromJsonString($json,
            $this->normalizeStatusCode($e),
            $this->normalizeHeaders($e)
        );
    }
protected function makeJsonResponse(Exception $e): IResponse
    {
        $whoops = $this->makeWhoops();
        $whoops->pushHandler($this->makeJsonResponseHandler());

        // JSON 响应结果的物理路径做安全处理
        $json = $whoops->handleException($e);
        $json = json_decode($json, true);
        $json['error']['file'] = $this->filterPhysicalPath($json['error']['file']);
        $json = json_encode($json);

        return JsonResponse::fromJsonString($json,
            $this->normalizeStatusCode($e),
            $this->normalizeHeaders($e)
        );
    }
JSON 响应异常.

@param \Exception $e

@return \Leevel\Http\IResponse