Skip to content
Permalink
Browse files

Debugger::errorHandler correctly fill-in error_get_last() when $logSe…

…verity is used
  • Loading branch information
dg committed Nov 28, 2019
1 parent 9e39e70 commit 9535542260ecde2a16aca4dd6e22a5356d0e60cd
Showing with 4 additions and 2 deletions.
  1. +2 −2 src/Tracy/Debugger/Debugger.php
  2. +2 −0 tests/Tracy/Debugger.logSeverity.E_NOTICE.phpt
@@ -371,7 +371,6 @@ public static function errorHandler(int $severity, string $message, string $file
throw $e;
} elseif (($severity & error_reporting()) !== $severity) { // muted errors
return false; // calls normal error handler to fill-in error_get_last()
} elseif (self::$productionMode) {
if (($severity & self::$logSeverity) === $severity) {
@@ -386,7 +385,6 @@ public static function errorHandler(int $severity, string $message, string $file
self::log($e, self::ERROR);
} catch (\Throwable $foo) {
}
return null;
} elseif (
(is_bool(self::$strictMode) ? self::$strictMode : ((self::$strictMode & $severity) === $severity)) // $strictMode
@@ -410,6 +408,8 @@ public static function errorHandler(int $severity, string $message, string $file
return Helpers::isHtmlMode() || Helpers::isAjax() ? null : false; // false calls normal error handler
}
}
return false; // calls normal error handler to fill-in error_get_last()
}
@@ -19,5 +19,7 @@ Debugger::$logSeverity = E_NOTICE;
$variable = $missingVariable;
Assert::same('Undefined variable: missingVariable', error_get_last()['message']);
Assert::count(1, glob(getTempDir() . '/error*.html'));
Assert::count(1, glob(getTempDir() . '/error.log'));

0 comments on commit 9535542

Please sign in to comment.
You can’t perform that action at this time.