diff --git a/library/think/Error.php b/library/think/Error.php index 9de97c88..140fbb24 100644 --- a/library/think/Error.php +++ b/library/think/Error.php @@ -63,9 +63,12 @@ class Error */ public static function appError($errno, $errstr, $errfile = '', $errline = 0, $errcontext = []) { + $exception = new ErrorException($errno, $errstr, $errfile, $errline, $errcontext); if (error_reporting() & $errno) { // 将错误信息托管至 think\exception\ErrorException - throw new ErrorException($errno, $errstr, $errfile, $errline, $errcontext); + throw $exception; + }else{ + self::getExceptionHandler()->report($exception); } }