Docket.Run.Failure (docket v0.1.1)

Copy Markdown View Source

Durable, JSON-safe description of a terminal graph failure.

A failure is present on a Docket.Run exactly when the run's status is :failed, and it survives storage round trips independently of retained event history. It describes only the terminal graph outcome: retryable node-attempt failures, operational poison facts, API validation errors, fence loss, and observer failures are separate concerns and never appear here.

Fields:

  • code - stable, machine-matchable identifier for the failure class. Codes produced by Docket are stable across releases.
  • message - human-readable description.
  • node_id - the failing node, when the failure is attributable to exactly one node.
  • details - open JSON-safe map with failure-class-specific facts.

Summary

Functions

Builds a failure, validating field shapes.

Types

t()

@type t() :: %Docket.Run.Failure{
  code: String.t(),
  details: map(),
  message: String.t(),
  node_id: String.t() | nil
}

Functions

new(code, message, opts \\ [])

@spec new(String.t(), String.t(), keyword()) :: t()

Builds a failure, validating field shapes.

code and message must be non-empty strings. Options: :node_id (string) and :details (string-keyed map). Raises ArgumentError on malformed input.