Fred.Error exception (Fred v0.4.0)

Copy Markdown View Source

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

Summary

Types

error_type()

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

t()

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