PHP获取异常信息
程序员文章站
2022-06-22 13:01:18
try { } catch (\Exception $e) { $extra = [ 'code' => $e->getCode(), 'msg' => $e->getMessage(), 'line' => $e->getLine()... ......
try {
} catch (\exception $e) {
$extra = [
'code' => $e->getcode(),
'msg' => $e->getmessage(),
'line' => $e->getline(),
'file' => $e->getfile()
];
return $this->apierror('接口请求失败', '', $extra);
}
上一篇: Python学习之旅(二十六)