# `Fred.Error`
[🔗](https://github.com/akoutmos/fred/blob/master/lib/fred/error.ex#L1)

Structured error type for FRED API errors.

## Error Types

  - `:api_error` - The FRED API returned a non-200 status code
  - `:parse_error` - Failed to parse the API response
  - `:request_error` - Other request failure
  - `:missing_api_key` - An API key was not configured for the Fred library
  - `:option_error` - The provided options for a given function were malformed

# `error_type`

```elixir
@type error_type() ::
  :api_error | :parse_error | :request_error | :missing_api_key | :option_error
```

# `t`

```elixir
@type t() :: %Fred.Error{
  __exception__: true,
  message: String.t(),
  status: integer() | nil,
  type: error_type()
}
```

---

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