Commit f85b3e0c by yeran

commit

1 parent 5fda5a9b
Showing with 7 additions and 2 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"description": "Phalcon", "description": "Phalcon",
"keywords": ["phwoolcon"], "keywords": ["phwoolcon"],
"type": "library", "type": "library",
"version": "1.0.10", "version": "1.0.11",
"license": "proprietary", "license": "proprietary",
"authors": [ "authors": [
{ {
......
...@@ -248,6 +248,10 @@ class Router extends PhalconRouter implements ServiceAwareInterface ...@@ -248,6 +248,10 @@ class Router extends PhalconRouter implements ServiceAwareInterface
return $e->toResponse(); return $e->toResponse();
//return static::$runningUnitTest ? $e : $e->toResponse(); //return static::$runningUnitTest ? $e : $e->toResponse();
} catch (\Exception $exception) { } catch (\Exception $exception) {
$uuid = md5(uniqid(md5(microtime(true)), true));
$exceptionMessage = $exception->getMessage() . '---' . "['ERRORID:'{$uuid}]";
debug('[Exception] File:[' . $exception->getFile() . '] ' . 'Line:[' . $exception->getLine() . '] ' . 'Message:[' . $exceptionMessage . '] ', 'ERROR');
//捕获异常 //捕获异常
$response = new Response(); //获取响应实例 $response = new Response(); //获取响应实例
//判断是否为API异常 //判断是否为API异常
...@@ -262,7 +266,8 @@ class Router extends PhalconRouter implements ServiceAwareInterface ...@@ -262,7 +266,8 @@ class Router extends PhalconRouter implements ServiceAwareInterface
} }
$response->setContent($exception->getBody()); //设置响应内容 $response->setContent($exception->getBody()); //设置响应内容
} else { } else {
return self::exceptionResponse($response, $exception->getMessage()); $errorMessage = "系统繁忙[ERRORID:{$uuid}]";
return self::exceptionResponse($response, $errorMessage);
} }
return $response; return $response;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!