# `Twilio.Error`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/error.ex#L1)

Twilio API error.

Represents both API errors (4xx/5xx responses with Twilio error bodies)
and connection-level errors (network failures, timeouts).

# `error_type`

```elixir
@type error_type() ::
  :api_error
  | :authentication_error
  | :rate_limit_error
  | :not_found_error
  | :invalid_request_error
  | :connection_error
```

# `t`

```elixir
@type t() :: %Twilio.Error{
  code: integer() | nil,
  details: map() | nil,
  http_body: String.t() | nil,
  http_status: integer() | nil,
  message: String.t() | nil,
  more_info: String.t() | nil,
  request_id: String.t() | nil,
  retry_after: integer() | nil,
  type: error_type()
}
```

# `connection_error`

```elixir
@spec connection_error(String.t()) :: t()
```

Build a connection error.

# `from_response`

```elixir
@spec from_response(integer(), String.t(), list()) :: t()
```

Build error from HTTP response status, body, and headers.

# `retryable?`

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

Is this error retryable?

---

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