WasiExitException Class

Thrown by the proc_exit function of WASI: it ends the execution of the module, and is thrown by the call into WebAssembly. WasiContext.Run catches it and returns WasiExitException.ExitCode.

public sealed class WasiExitException : Exception
Inheritance
Exception WasiExitException

Constructors

NameDescription
WasiExitException()Initializes a new instance of the WasiExitException class whose exit code is 0.
WasiExitException(int)Initializes a new instance of the WasiExitException class.
WasiExitException(string)Initializes a new instance of the WasiExitException class whose exit code is 1.
WasiExitException(string, Exception?)Initializes a new instance of the WasiExitException class whose exit code is 1.

WasiExitException overloads

WasiExitException()

WasiExceptions.cs

Initializes a new instance of the WasiExitException class whose exit code is 0.

public WasiExitException()

WasiExitException(int)

WasiExceptions.cs

Initializes a new instance of the WasiExitException class.

public WasiExitException(int exitCode)
Parameters
exitCode int
The exit code of the module.

WasiExitException(string)

WasiExceptions.cs

Initializes a new instance of the WasiExitException class whose exit code is 1.

public WasiExitException(string message)
Parameters
message string
The message of the exception.

WasiExitException(string, Exception?)

WasiExceptions.cs

Initializes a new instance of the WasiExitException class whose exit code is 1.

public WasiExitException(string message, Exception? innerException)
Parameters
message string
The message of the exception.
innerException Exception?
The exception that caused the exit.

Properties

NameDescription
ExitCodeGets the exit code of the module.

Gets the exit code of the module.

public int ExitCode { get; }

Property value

int