From 0ad2e4b96bec2fa93531dc2190f98c86940f7326 Mon Sep 17 00:00:00 2001 From: Walmir Silva Date: Sat, 26 Oct 2024 09:56:30 -0300 Subject: [PATCH] fix: add previous in createException method --- src/AbstractException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AbstractException.php b/src/AbstractException.php index e97d0ac..aba4ebf 100644 --- a/src/AbstractException.php +++ b/src/AbstractException.php @@ -36,8 +36,8 @@ protected function addContext(string $key, mixed $value): self return $this; } - protected static function createException(int $code, string $errorCode, string $message): self + protected static function createException(int $code, string $errorCode, string $message, ?\Throwable $previous = null): self { - return new static(new ExceptionMessage($code, $errorCode, $message)); + return new static(new ExceptionMessage($code, $errorCode, $message), $previous); } }