Skip to main content

TransitionError

Thrown when StateEvents.onExit or StateEvents.onEntry throws during a transition.

Extends

Type Parameters

Context

Context

Protocol

Protocol extends { } | undefined

EventName

EventName extends keyof Protocol

Constructors

Constructor

new TransitionError<Context, Protocol, EventName>(hsm, cause, failedStateName, failedCallback, fromStateName, toStateName): TransitionError<Context, Protocol, EventName>

Parameters

hsm

State<Context, Protocol>

Machine view at failure time

cause

Error

Error thrown from the lifecycle hook

failedStateName

string

Display name of the state whose hook failed

failedCallback

"onExit" | "onEntry"

Which hook failed (onExit or onEntry)

fromStateName

string

Leaf state before the transition

toStateName

string

Requested destination state

Returns

TransitionError<Context, Protocol, EventName>

Overrides

RuntimeError.constructor

Properties

name

name: string

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

Inherited from

RuntimeError.name


topStateName

topStateName: string

Properties.topStateName when the error was constructed.

Inherited from

RuntimeError.topStateName


stateName

stateName: string

Properties.currentStateName when the error was constructed.

Inherited from

RuntimeError.stateName


context

context: Context

Snapshot of State.ctx when the error was constructed.

Inherited from

RuntimeError.context


cause?

optional cause?: Error

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

Inherited from

RuntimeError.cause


eventName

eventName: PostedEvent<Protocol, EventName>

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

Inherited from

RuntimeError.eventName


eventPayload

eventPayload: EventPayload<Protocol, EventName>

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

Inherited from

RuntimeError.eventPayload


failedStateName

failedStateName: string

Display name of the state whose hook failed


failedCallback

failedCallback: "onExit" | "onEntry"

Which hook failed (onExit or onEntry)


fromStateName

fromStateName: string

Leaf state before the transition


toStateName

toStateName: string

Requested destination state