Portals.Error (portals v0.1.0)

Copy Markdown View Source

The single failure representation returned to every Portals caller (FR-4). All non-{:ok, value} outcomes are {:error, %Portals.Error{}}.

Summary

Functions

Build a %Portals.Error{} from a decoded wire ERROR frame's error map.

Types

kind()

@type kind() ::
  :transport
  | :protocol
  | :remote
  | :checkout_timeout
  | :execution_timeout
  | :cancelled
  | :overload
  | :worker_exit

t()

@type t() :: %Portals.Error{
  details: map(),
  kind: kind(),
  message: binary(),
  remote: map() | nil,
  stacktrace: [binary()] | nil
}

Functions

from_wire(error_map)

@spec from_wire(map()) :: t()

Build a %Portals.Error{} from a decoded wire ERROR frame's error map.

known_kinds()

@spec known_kinds() :: [kind()]

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

@spec new(kind(), binary(), keyword()) :: t()