SquidMesh.Tools.Error (squid_mesh v0.1.0-alpha.3)

Copy Markdown View Source

Normalized tool failure shape.

Summary

Functions

Builds a normalized tool error.

Converts a tool error into a plain map suitable for step error payloads.

Types

kind()

@type kind() ::
  :adapter_contract
  | :http
  | :invalid_context
  | :invalid_request
  | :timeout
  | :transport

t()

@type t() :: %SquidMesh.Tools.Error{
  adapter: module(),
  details: map(),
  kind: kind(),
  message: String.t(),
  retryable?: boolean()
}

Functions

new(attrs)

@spec new(keyword()) :: t()

Builds a normalized tool error.

to_map(error)

@spec to_map(t()) :: map()

Converts a tool error into a plain map suitable for step error payloads.