Weavr.Error.API exception (Weavr v1.0.0)

Copy Markdown View Source

Raised/returned when the Weavr API responds with an HTTP error status (4xx or 5xx) and a parsed error body.

Field meanings follow the response shapes documented for Weavr Multi endpoints (see e.g. the bulks/{bulk_id} operation):

  • :status - the HTTP status code (400, 401, 403, 404, 409, 429, 500, 503, ...)
  • :code - the API-provided machine-readable error code, when present (e.g. "INSUFFICIENT_PERMISSIONS", "REQUIRED")
  • :message - the API-provided human-readable message, when present
  • :errors - structured per-field validation errors, when the API returns a syntaxErrors.invalidFields-style payload
  • :body - the full decoded JSON response body, for anything not captured by the fields above
  • :request_id - the value of the response's request/trace id header, if Weavr returned one, useful when contacting Weavr support

Summary

Types

t()

@type t() :: %Weavr.Error.API{
  __exception__: true,
  body: map() | nil,
  code: String.t() | nil,
  errors: list() | nil,
  message: String.t() | nil,
  request_id: String.t() | nil,
  status: pos_integer()
}