EventHandlerError
Thrown when an event handler body throws and StateEvents.onError does not recover.
Extends
RuntimeError<Context,Protocol,EventName>
Type Parameters
Context
Context
Protocol
Protocol extends { } | undefined
EventName
EventName extends keyof Protocol
Constructors
Constructor
new EventHandlerError<
Context,Protocol,EventName>(hsm,cause):EventHandlerError<Context,Protocol,EventName>
Parameters
hsm
State<Context, Protocol>
Machine view with eventName set to the failing handler
cause
Error
Error thrown from handler code
Returns
EventHandlerError<Context, Protocol, EventName>
Overrides
Properties
name
name:
string
Discriminator matching the class name (EventHandlerError, etc.).
Inherited from
topStateName
topStateName:
string
Properties.topStateName when the error was constructed.
Inherited from
stateName
stateName:
string
Properties.currentStateName when the error was constructed.
Inherited from
context
context:
Context
Snapshot of State.ctx when the error was constructed.
Inherited from
cause?
optionalcause?:Error
Original thrown value when this error wraps a handler or lifecycle failure.
Inherited from
eventName
eventName:
PostedEvent<Protocol,EventName>
Event or service name that was active when the failure occurred.
Inherited from
eventPayload
eventPayload:
EventPayload<Protocol,EventName>
Client-supplied arguments (excluding resolve/reject for services).