# `TwitterViewer.APIError`
[🔗](https://github.com/TwitterViewer/twitterviewer-elixir/blob/v0.1.0/lib/twitterviewer/error.ex#L29)

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

# `t`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
