aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Execution/TrapException.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Execution/TrapException.php')
-rw-r--r--src/Execution/TrapException.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Execution/TrapException.php b/src/Execution/TrapException.php
index 2948e8d..3e6a440 100644
--- a/src/Execution/TrapException.php
+++ b/src/Execution/TrapException.php
@@ -5,7 +5,24 @@ declare(strict_types=1);
namespace Nsfisis\Waddiwasi\Execution;
use RuntimeException;
+use Throwable;
class TrapException extends RuntimeException
{
+ private readonly TrapKind $trapKind;
+
+ public function __construct(
+ string $message = "",
+ int $code = 0,
+ ?Throwable $previous = null,
+ TrapKind $trapKind = TrapKind::Unknown,
+ ) {
+ parent::__construct($message, $code, $previous);
+ $this->trapKind = $trapKind;
+ }
+
+ public function getTrapKind(): TrapKind
+ {
+ return $this->trapKind;
+ }
}