# `Movoa.Error`
[🔗](https://github.com/hanshs474/movoa-ex/blob/main/lib/movoa/error.ex#L1)

The error every `Movoa` call returns as `{:error, %Movoa.Error{}}` (and the
bang functions raise). Branch on `reason`:

  * `:auth` - no API key, or the key is wrong or deleted; create one at
    https://movoa.ai/settings/apikeys
  * `:rejected` - the content filter refused the prompt, or the account is
    cooling down after a refusal; reword rather than retry
  * `:quota` - not enough credits left for this run
  * `:plan` - this model or quality needs a plan, or the account has not
    bought credits yet
  * `:busy` - another generation on this account is still running
  * `:failed` - the run was accepted and then failed or was canceled;
    `error_message` and `failure_kind` say why
  * `:timeout` - the wait ran out; the run may still finish, look it up
    later with `Movoa.status/2` and `task_id`
  * `:other` - anything else: a network failure, a 5xx, a non-JSON answer

# `reason`

```elixir
@type reason() ::
  :auth | :rejected | :quota | :plan | :busy | :failed | :timeout | :other
```

# `t`

```elixir
@type t() :: %Movoa.Error{
  __exception__: true,
  error_message: String.t() | nil,
  failure_kind: String.t() | nil,
  message: String.t(),
  reason: reason(),
  status: integer() | nil,
  task_id: String.t() | nil
}
```

---

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