Commit b0a1b295 by zhufx

解析异常信息

parent a5966701
......@@ -11,13 +11,20 @@ class ExceptionParseData
{
public static function parseData(\Exception $e)
{
if ( is_callable($e,'getResponse') ) {
$response = $e->getResponse();
preg_match("/{.*}/",$response['msg'],$data);
$msg = isset($data['0'])?$data['0']:'';
return json_decode($msg,true);
$data = json_decode($msg,true);
} else {
$data['msg'] = $e->getMessage();
$data['code'] = $e->getCode();
$data['file'] = $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