PaperForge.Error (PaperForge v1.4.5)

Copy Markdown View Source

Stable, structured failure returned by bounded production operations.

code is intended for programmatic handling. The PF8xxx range covers runtime execution, timeouts, cancellation, and circuit-breaker decisions.

Summary

Types

t()

@type t() :: %PaperForge.Error{
  category: :timeout | :resource | :runtime | :cancelled,
  code: binary(),
  details: map() | nil,
  message: binary(),
  operation: atom() | nil,
  retryable?: boolean()
}

Functions

cancelled(operation)

@spec cancelled(atom()) :: t()

circuit_open(resource, retry_after_ms)

@spec circuit_open(term(), non_neg_integer()) :: t()

resource_limit(resource, value, limit)

@spec resource_limit(atom(), non_neg_integer(), non_neg_integer()) :: t()

timeout(operation, timeout)

@spec timeout(atom(), timeout()) :: t()