Commit a5966701 by zhufx

解析异常信息

parent 193886da
......@@ -11,28 +11,12 @@ class ExceptionParseData
{
public static function parseData(\Exception $e)
{
$exception = $e->getMessage();
$pos = strpos($exception,"the return status of rpc is incorrected,data");
if ( false !== $pos ) {
$exception = str_replace("the return status of rpc is incorrected,data=","",$exception);
$response = $e->getResponse();
$throw_data = json_decode($exception,true);
$parse_data = explode(' ',$throw_data['msg']);
$data = ['msg' => $parse_data[0], 'file' => $parse_data[1], 'line' => $parse_data[2], 'code' => $throw_data['status']];
} else {
$file = $e->getFile();
$line = $e->getLine();
$code = $e->getCode();
$exception = $e->getMessage();
$data = ['msg' => $exception, 'file' => $file, 'line' => $line, 'code' => $code];
}
return $data;
preg_match("/{.*}/",$response['msg'],$data);
$msg = isset($data['0'])?$data['0']:'';
return json_decode($msg,true);
}
......
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