aion/awl/error

The fixed AWL workflow-error taxonomy: the AwlError type every generated AWL module returns, its wire codec, and the six runtime-error mappers.

Hoisted out of the emitted surface by AWL-BC-0 (hoist-only): the codec and the mappers are workflow-independent fixed glue, identical across every generated module. The variant atoms and the JSON shape are byte-identical to the code the emitter used to inline, so durable trails and wire payloads are unchanged by the move.

Types

The error type every generated AWL workflow returns. One variant per failure class the language surfaces; AwlOutcomeFailure carries the routed failure outcome name and its encoded payload.

pub type AwlError {
  AwlDecodeInputFailed(String)
  AwlActivityFailed(String)
  AwlSignalFailed(String)
  AwlChildFailed(String)
  AwlTimerFailed(String)
  AwlTimedOut(String)
  AwlIndexOutOfRange(String)
  AwlVisitsExceeded(String)
  AwlOutcomeFailure(outcome: String, payload: String)
  AwlFailed
}

Constructors

  • AwlDecodeInputFailed(String)
  • AwlActivityFailed(String)
  • AwlSignalFailed(String)
  • AwlChildFailed(String)
  • AwlTimerFailed(String)
  • AwlTimedOut(String)
  • AwlIndexOutOfRange(String)
  • AwlVisitsExceeded(String)
  • AwlOutcomeFailure(outcome: String, payload: String)
  • AwlFailed

Values

pub fn codec() -> codec.Codec(AwlError)

The workflow-error codec bound into every generated definition().

pub fn map_activity_error(
  result: Result(a, error.ActivityError),
) -> Result(a, AwlError)

Collapse an activity dispatch failure to a step failure.

pub fn map_child_error(
  result: Result(a, error.ChildError(AwlError)),
) -> Result(a, AwlError)

Collapse an awaited child-workflow failure to a step failure.

pub fn map_engine_error(
  result: Result(a, error.EngineError),
) -> Result(a, AwlError)

Collapse a workflow-context lookup failure to the language’s generic workflow failure. The context lookup is normally infallible for registered workflow code; retaining the Result keeps misuse outside that context loud.

pub fn map_receive_error(
  result: Result(a, error.ReceiveError),
) -> Result(a, AwlError)

Collapse a signal receive failure to a step failure.

pub fn map_spawn_error(
  result: Result(a, error.EngineError),
) -> Result(a, AwlError)

Collapse a detached-spawn failure to a step failure.

pub fn map_timer_error(
  result: Result(a, error.EngineError),
) -> Result(a, AwlError)

Collapse a timer/sleep failure to a step failure.

Search Document