ApolloSignal.Errors exception (apollo_signal v4.0.1)

Copy Markdown View Source

Structured API and transport errors for Apollo Signal API.

Summary

Types

t()

@type t() :: %ApolloSignal.Errors{
  __exception__: true,
  code: String.t() | nil,
  message: String.t(),
  method: atom() | String.t() | nil,
  path: String.t() | nil,
  request_id: String.t() | nil,
  response_body: term(),
  response_headers: term(),
  retry_after_ms: non_neg_integer() | nil,
  status: non_neg_integer() | nil
}

Functions

from_exception(exception, method, path)

@spec from_exception(Exception.t() | term(), atom() | String.t(), String.t()) :: t()

from_response(status, headers, body, method, path)

@spec from_response(
  non_neg_integer(),
  term(),
  term(),
  atom() | String.t(),
  String.t()
) :: t()

header(headers, name)

@spec header(term(), String.t()) :: String.t() | nil

request_id(headers, body)

@spec request_id(term(), term()) :: String.t() | nil

retry_after_ms(headers)

@spec retry_after_ms(term()) :: non_neg_integer() | nil