Skip to main content

InitializationError

Thrown when StateEvents.onEntry fails during the initial @InitialState walk at startup.

Extends

Type Parameters

Context

Context

Protocol

Protocol extends { } | undefined

Constructors

Constructor

new InitializationError<Context, Protocol>(hsm, failedState, cause): InitializationError<Context, Protocol>

Parameters

hsm

State<Context, Protocol>

Partially initialized machine

failedState

StateClass<Context, Protocol>

State class whose onEntry threw

cause

Error

Original error from onEntry

Returns

InitializationError<Context, Protocol>

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


failedState

failedState: StateClass<Context, Protocol>

State class whose onEntry threw