# `ExWapp.Error.Ack`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/error/ack.ex#L1)

Classifies the `error` attribute WhatsApp puts on a message acknowledgement.

A rejection code answers a question the caller cannot answer any other way:
whether to send the message again, and if so whether anything has to change
first. Collapsing every code to `:failed` throws that away, leaving callers to
choose between retrying a permanently refused message and giving up on a
transient one.

Only codes this library has direct evidence for are classified. Everything
else is `:unknown`, which callers must treat as *not* safely retryable — an
unrecognised rejection is far more likely to be a policy refusal that repeats
than a blip that clears, and retrying into a refusal is how a number gets
rate limited or banned.

# `category`

```elixir
@type category() :: :session | :throttled | :transient | :permanent | :unknown
```

# `t`

```elixir
@type t() :: %ExWapp.Error.Ack{
  category: category(),
  code: String.t(),
  detail: String.t(),
  retriable?: boolean()
}
```

# `classify`

```elixir
@spec classify(String.t() | nil) :: t()
```

Classifies a raw `error` attribute value.

`retriable?` means "sending this message again may succeed", not "send it
again immediately" — `:throttled` in particular requires a backoff.

# `retriable?`

```elixir
@spec retriable?(t()) :: boolean()
```

True when the send may be attempted again, possibly after repairing state.

---

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