# `YouTubeTranscriptNet.Error`
[🔗](https://github.com/youtube-transcript/youtubetranscript-elixir/blob/v0.1.0/lib/youtubetranscript_net/error.ex#L1)

The only error the SDK returns (and raises from `YouTubeTranscriptNet.new!/1`).

  * `:status` - HTTP status, `0` for errors raised locally
  * `:code` - the server's `error.code`, or `HTTP_<status>`, `NETWORK_ERROR`, `TIMEOUT`,
    `API_KEY_REQUIRED`, `INVALID_REQUEST`, `INVALID_RESPONSE`, `TRANSCRIPT_FAILED`
  * `:message` - a readable message
  * `:request_id` - the `X-Request-Id` response header; include it when you contact support
  * `:retry_after` - seconds from `Retry-After`, or `nil`
  * `:details` - the server's `error` object as-is (`"availableLanguages"`, `"creditsRequired"`, ...)
  * `:job_id` - set on `TIMEOUT` and failed jobs when a job was involved
  * `:retryable` - `true` for 429, 5xx and `NETWORK_ERROR`

# `t`

```elixir
@type t() :: %YouTubeTranscriptNet.Error{
  __exception__: term(),
  code: String.t(),
  details: map() | nil,
  job_id: String.t() | nil,
  message: String.t(),
  request_id: String.t() | nil,
  retry_after: number() | nil,
  retryable: boolean(),
  status: non_neg_integer()
}
```

# `retryable?`

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

True for 429, 5xx and `NETWORK_ERROR`.

---

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