Boop.Error (BoopEx v1.0.0)

Copy Markdown View Source

Why a send failed. Returned as {:error, %Boop.Error{}}; never raised.

code is one of:

  • :invalid — the event failed local validation (nothing was sent)
  • :not_configured — no url or api_key
  • :unauthorized — the server rejected the API key (401)
  • :rejected — the server rejected the event (400/413/422); see message
  • :server_error — the server failed (5xx) after retries
  • :unreachable — network error or timeout after retries
  • :unexpected — anything else, including exceptions

Summary

Functions

Whether retrying the same request could succeed.

Types

code()

@type code() ::
  :invalid
  | :not_configured
  | :unauthorized
  | :rejected
  | :server_error
  | :unreachable
  | :unexpected

t()

@type t() :: %Boop.Error{
  code: code(),
  details: term(),
  message: String.t(),
  status: non_neg_integer() | nil
}

Functions

retryable?(error)

@spec retryable?(t()) :: boolean()

Whether retrying the same request could succeed.