PHP获取异常信息

 try {
           
        } catch (\Exception $e) {
            $extra = [
                'code' => $e->getCode(),
                'msg' => $e->getMessage(),
                'line' => $e->getLine(),
                'file' => $e->getFile()
            ];
            return $this->apiError('接口请求失败', '', $extra);
        }

  

猜你喜欢

转载自www.cnblogs.com/blog-dyn/p/10082968.html