mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
优化一处数组的写法,避免Notice错误
This commit is contained in:
@@ -20,11 +20,13 @@ class Error
|
|||||||
*/
|
*/
|
||||||
public static function appException($e)
|
public static function appException($e)
|
||||||
{
|
{
|
||||||
$error['message'] = $e->getMessage();
|
$error = [
|
||||||
$error['file'] = $e->getFile();
|
'message' => $e->getMessage(),
|
||||||
$error['line'] = $e->getLine();
|
'file' => $e->getFile(),
|
||||||
$error['trace'] = $e->getTraceAsString();
|
'line' => $e->getLine(),
|
||||||
$error['code'] = $e->getCode();
|
'trace' => $e->getTraceAsString(),
|
||||||
|
'code' => $e->getCode(),
|
||||||
|
];
|
||||||
// 记录异常日志
|
// 记录异常日志
|
||||||
Log::record($error['message'], 'ERR');
|
Log::record($error['message'], 'ERR');
|
||||||
// 发送404信息
|
// 发送404信息
|
||||||
@@ -98,9 +100,11 @@ class Error
|
|||||||
exit($message);
|
exit($message);
|
||||||
} elseif (IS_API) {
|
} elseif (IS_API) {
|
||||||
// API接口
|
// API接口
|
||||||
$data['code'] = $code;
|
$data = [
|
||||||
$data['msg'] = $message;
|
'code' => $code,
|
||||||
$data['time'] = NOW_TIME;
|
'msg' => $message,
|
||||||
|
'time' => NOW_TIME,
|
||||||
|
];
|
||||||
Response::returnData($data);
|
Response::returnData($data);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user