# StateHandlingErrorHandler

typealias StateHandlingErrorHandler < T > = suspend ( T , Throwable ) -> T ?(source)

A handler function type for dealing with errors during state handling in a finite state machine. The handler receives the state that caused the error and the thrown exception, and can optionally return a new state to continue the chain, or null to end the chain.

#### Return

A new state to continue with, or null to end the state chain

#### Parameters

Throwable

The exception that was thrown during state handling

#### Type Parameters

T

The state type that caused the error