# `Noizu.Slack.Error`
[🔗](https://github.com/noizu-labs-sdks/elixir-slack/blob/v0.1.0/lib/noizu/slack/error.ex#L1)

Structured error returned by every failing `Noizu.Slack` call as
`{:error, %Noizu.Slack.Error{}}` — never raised in the normal flow.

The struct implements `Exception` so a mid-stream pagination failure can raise it
(`Stream`s cannot return error tuples).

Fields:

  * `:tag` — failure class:
    * `:api` — Slack answered `{"ok": false, "error": "..."}`; `:reason` is the
      Slack error string (e.g. `"channel_not_found"`), kept verbatim (no atoms are
      created from network data).
    * `:rate_limited` — HTTP 429 persisted past the bounded retry; `:reason` is the
      Slack error string when present (usually `"ratelimited"`).
    * `:http` — any other non-2xx response without an `ok:false` envelope.
    * `:invalid_response` — a 2xx response whose body is not a Slack envelope.
    * `:transport` — connection refused, timeout, TLS…; `:reason` is the exception.
    * `:config` — missing token or bad arguments; `:reason` is an atom.
    * `:upload` — the `files.upload` byte-transfer step failed.
    * `:webhook` — an incoming-webhook post failed; `:reason` is Slack's text body.
    * `:signature` — `Noizu.Slack.Signature.verify/5` rejected a request; `:reason`
      is `:invalid_signature`, `:stale_timestamp`, or `:invalid_timestamp`.
    * `:blocks` — `Noizu.Slack.Blocks.validate/1` rejected a payload.
  * `:status` — HTTP status when a response arrived.
  * `:body` — decoded response body (map) or raw body.
  * `:message` / `:summary` — human-readable description.

# `t`

```elixir
@type t() :: %Noizu.Slack.Error{
  __exception__: term(),
  body: term(),
  message: String.t() | nil,
  reason: term(),
  status: pos_integer() | nil,
  summary: String.t() | nil,
  tag: tag() | nil
}
```

# `tag`

```elixir
@type tag() ::
  :api
  | :rate_limited
  | :http
  | :invalid_response
  | :transport
  | :config
  | :upload
  | :webhook
  | :signature
  | :blocks
```

---

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