aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Execution/TrapException.php
blob: 449f9ca77b18fd214959ee6dddbf637c92e6227b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

declare(strict_types=1);

namespace Nsfisis\Waddiwasi\WebAssembly\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;
    }
}