Skip to content

Commit

Permalink
Fix test suite for aide-error
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jan 6, 2024
1 parent 83bf8ea commit c5cb9e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Error/Cloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,14 @@ protected function errorHandler(int $errno, string $errstr, string $errfile = nu
}

$this->errors->unshift(new ErrorException($errstr, 0, $errno, $errfile, $errline));
if ($this->errorsAreThrown()) {
/** @var ErrorException $error */
$error = $this->errors->last();

return $this->errorsAreThrown() ? throw $this->errors->last() : true;
throw $error;
}

return true;
}

public static function throwOnError(): void
Expand Down

0 comments on commit c5cb9e1

Please sign in to comment.