TwitterViewer.APIError exception (TwitterViewer v0.1.0)

Copy Markdown View Source

The API answered with a non-2xx status.

  • :status - HTTP status
  • :code - one of the TwitterViewer.ErrorCode values; nil when the body is not an API error (for example a gateway error page)
  • :message - a readable message; branch on :code, not on this
  • :retry_after_sec - seconds to wait before trying again, when the server says so
  • :details - extra data with string keys, such as "reason", "required" and "balance" on a 402

Summary

Types

t()

@type t() :: %TwitterViewer.APIError{
  __exception__: term(),
  code: String.t() | nil,
  details: map(),
  message: String.t(),
  retry_after_sec: number() | nil,
  status: non_neg_integer()
}