首页 > 技术文章 > PHP获取异常信息

blog-dyn 2018-12-07 14:59 原文

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

  

推荐阅读