Movoa.Error exception (movoa v0.1.0)

Copy Markdown View Source

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

Summary

Types

reason()

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

t()

@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
}