UOF.API.Error exception (UOF_API v3.0.0)

Copy Markdown View Source

An error returned by the UOF HTTP client.

type distinguishes errors returned by the API from transport and response decoding failures. For HTTP errors, status is the numeric HTTP status and response_code is the separate code supplied by Sportradar in the response body, when present.

The remaining fields contain:

  • headers — response headers, including values such as retry-after
  • body — a decoded XML/JSON body when possible, otherwise the raw body
  • reason — the underlying transport or decoding failure
  • message — a human-readable error summary

Summary

Types

error_type()

@type error_type() :: :http | :transport | :decode

t()

@type t() :: %UOF.API.Error{
  __exception__: term(),
  body: term(),
  headers: map(),
  message: String.t(),
  reason: term(),
  response_code: String.t() | nil,
  status: non_neg_integer() | nil,
  type: error_type()
}