Skip to content

Commit 2deabbf

Browse files
committed
refactor: error handler callback to return false
1 parent d5096b2 commit 2deabbf

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

system/Debug/Exceptions.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,19 @@ public function exceptionHandler(Throwable $exception)
147147
*
148148
* This seems to be primarily when a user triggers it with trigger_error().
149149
*
150+
* @return bool
151+
*
150152
* @throws ErrorException
151153
*
152154
* @codeCoverageIgnore
153155
*/
154156
public function errorHandler(int $severity, string $message, ?string $file = null, ?int $line = null)
155157
{
156-
if (! (error_reporting() & $severity)) {
157-
return;
158+
if (error_reporting() & $severity) {
159+
throw new ErrorException($message, 0, $severity, $file, $line);
158160
}
159161

160-
throw new ErrorException($message, 0, $severity, $file, $line);
162+
return false; // return false to propagate the error to PHP standard error handler
161163
}
162164

163165
/**

0 commit comments

Comments
 (0)