|
|
@@ -165,12 +165,12 @@ class ErrorHandler extends \yii\base\ErrorHandler
|
|
|
if (YII_DEBUG) {
|
|
|
$it['type'] = get_class($exception);
|
|
|
// if (!$exception instanceof UserException) {
|
|
|
- $it['file'] = $exception->getFile() ?? '';
|
|
|
- $it['line'] = $exception->getLine() ?? '';
|
|
|
- $it['stack-trace'] = explode("\n", $exception->getTraceAsString()) ?? '';
|
|
|
- if ($exception instanceof \yii\db\Exception) {
|
|
|
- $it['error-info'] = $exception->errorInfo ?? '';
|
|
|
- }
|
|
|
+ $it['file'] = $exception->getFile() ?? '';
|
|
|
+ $it['line'] = $exception->getLine() ?? '';
|
|
|
+ $it['stack-trace'] = explode("\n", $exception->getTraceAsString()) ?? '';
|
|
|
+ if ($exception instanceof \yii\db\Exception) {
|
|
|
+ $it['error-info'] = $exception->errorInfo ?? '';
|
|
|
+ }
|
|
|
// }
|
|
|
}
|
|
|
if (($prev = $exception->getPrevious()) !== null) {
|
|
|
@@ -179,8 +179,8 @@ class ErrorHandler extends \yii\base\ErrorHandler
|
|
|
|
|
|
// 错误日志写入
|
|
|
$it['trace-id'] = Tool::generateId();
|
|
|
+ LoggerTool::error($it);
|
|
|
|
|
|
- LoggerTool::error($message);
|
|
|
// 推送消息到预警平台
|
|
|
Alarm::reportAlarm($it);
|
|
|
|