Przeglądaj źródła

预警:非User异常报错信息捕获

kevin_zhangl 2 lat temu
rodzic
commit
94d34bc832
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      vendor/yiisoft/yii2/web/ErrorHandler.php

+ 6 - 6
vendor/yiisoft/yii2/web/ErrorHandler.php

@@ -163,14 +163,14 @@ 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 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['error-info'] = $exception->errorInfo ?? '';
                         }
-                    }
+//                    }
                 }
                 if (($prev = $exception->getPrevious()) !== null) {
                     $it['previous'] = $this->convertExceptionToArray($prev);