scamper/error

Error types for the scamper finite state machine library.

Types

The stage at which a callback failed during a transition.

pub type CallbackStage {
  OnExit
  OnTransition
  OnEnter
}

Constructors

  • OnExit
  • OnTransition
  • OnEnter

Errors that can occur when attempting a state transition.

pub type TransitionError(state, event) {
  InvalidTransition(from: state, event: event)
  GuardRejected(from: state, event: event, reason: String)
  AlreadyFinal(state: state)
  CallbackFailed(stage: CallbackStage, reason: String)
  InvariantViolation(reason: String)
}

Constructors

  • InvalidTransition(from: state, event: event)

    The transition is not defined in the transition table.

  • GuardRejected(from: state, event: event, reason: String)

    All guards for the matching transition rules rejected the event.

  • AlreadyFinal(state: state)

    The machine is in a final state and cannot process any events.

  • CallbackFailed(stage: CallbackStage, reason: String)

    A lifecycle callback failed during the transition.

  • InvariantViolation(reason: String)

    A context invariant was violated after the transition.

Search Document