Commit fdface16 by Carsten Brandt

added stack trace to exception output in API when YII_DEBUG is true

issues #303 and #2516
parent 44aab995
...@@ -89,7 +89,6 @@ class ErrorHandler extends Component ...@@ -89,7 +89,6 @@ class ErrorHandler extends Component
if (!YII_ENV_TEST) { if (!YII_ENV_TEST) {
exit(1); exit(1);
} }
return; return;
} }
...@@ -145,6 +144,9 @@ class ErrorHandler extends Component ...@@ -145,6 +144,9 @@ class ErrorHandler extends Component
'message' => $exception->getMessage(), 'message' => $exception->getMessage(),
'code' => $exception->getCode(), 'code' => $exception->getCode(),
]; ];
if (YII_DEBUG) {
$array['stack-trace'] = explode("\n", $exception->getTraceAsString());
}
if ($exception instanceof HttpException) { if ($exception instanceof HttpException) {
$array['status'] = $exception->statusCode; $array['status'] = $exception->statusCode;
} }
......
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