Commit 3664dc3d by feixiang

异常数据格式处理

parent 9d6ec5a4
......@@ -36,7 +36,7 @@ class CommonException extends Exception
}
if ( isset($params['path']) ) {
$this->path = $params['path'];
$this->path = empty($params['path'])?[]:$params['path'];
}
......
......@@ -36,10 +36,12 @@ class ExceptionData
"errCode" => is_callable([$e,'getErrCode'])?$e->getErrcode():'',
'path' =>[],
];
if ( is_callable([$e,"getPath"]) ) {
if ( is_callable([$e,"getPath"]) ) {//自建异常类处理path
$data['path'] = json_decode($e->getPath(), true);
} else { //系统异常统一报500错误
$data['code'] = 500;
}
//获取调用堆栈信息
......
......@@ -24,7 +24,7 @@ class ExceptionParseData
$data['code'] = 500;
$data['errorCode'] = -1;
$data['file'] = $e->getFile().' '.$e->getLine();
$data['path'] = [$e->getFile().' '.$e->getLine()];
$data['path'] = ['Service:'.APP_NAME.$e->getFile().' '.$e->getLine()];
}
return $data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment