Skip to main content

RuntimeError

Error base for failures during event dispatch, with correlated event metadata.

Extends

Extended by

Type Parameters

Context

Context

Domain context

Protocol

Protocol extends { } | undefined

Vocabulary interface

EventName

EventName extends keyof Protocol

Event or service key being processed

Constructors

Constructor

protected new RuntimeError<Context, Protocol, EventName>(errorName, hsm, message, cause?): RuntimeError<Context, Protocol, EventName>

Parameters

errorName

string

hsm

State<Context, Protocol>

message

string

cause?

Error

Returns

RuntimeError<Context, Protocol, EventName>

Overrides

HsmError.constructor

Properties

name

name: string

Discriminator matching the class name (EventHandlerError, etc.).

Inherited from

HsmError.name


topStateName

topStateName: string

Properties.topStateName when the error was constructed.

Inherited from

HsmError.topStateName


stateName

stateName: string

Properties.currentStateName when the error was constructed.

Inherited from

HsmError.stateName


context

context: Context

Snapshot of State.ctx when the error was constructed.

Inherited from

HsmError.context


cause?

optional cause?: Error

Original thrown value when this error wraps a handler or lifecycle failure.

Inherited from

HsmError.cause


eventName

eventName: PostedEvent<Protocol, EventName>

Event or service name that was active when the failure occurred.


eventPayload

eventPayload: EventPayload<Protocol, EventName>

Client-supplied arguments (excluding resolve/reject for services).