ExTypesafe.Error (ExTypesafe v0.1.0)

Copy Markdown View Source

Represents an error returned by the TypeSafe API or the client itself.

Fields

  • :status — HTTP status code (e.g. 401, 422, 429, 529), or :transport for network-level errors before a response is received.
  • :message — Human-readable description of the error.
  • :body — Raw response body map (if available), useful for inspecting validation details.

Common status codes

StatusMeaning
401Missing or invalid API key.
422Request body failed validation (missing field, malformed question, etc).
429Rate limit exceeded. Retried automatically with exponential backoff.
529TypeSafe temporarily overloaded. Retried automatically.

Summary

Types

status()

@type status() :: pos_integer() | :transport

t()

@type t() :: %ExTypesafe.Error{
  body: map() | nil,
  message: String.t(),
  status: status()
}