Nostrum.Error.ApiError exception (nostrum v0.11.0-dev)

View Source

Represents a failed response from the API.

This occurs when :gun fails, or when the API doesn't respond with 200 or 204. This should only be raised explicitly when using the banged API methods.

Summary

Types

detailed_error()

@type detailed_error() :: %{
  code: discord_status_code(),
  message: String.t(),
  errors: errors()
}

discord_status_code()

@type discord_status_code() :: 10001..90001

error()

@type error() :: %{code: discord_status_code(), message: String.t()}

error_list_map()

@type error_list_map() :: %{_errors: [error()]}

errors()

@type errors() ::
  %{required(String.t()) => errors()}
  | %{required(String.t()) => error_list_map()}

response()

@type response() :: String.t() | error() | detailed_error()

status_code()

@type status_code() :: 100..511

t()

@type t() :: %{status_code: status_code(), response: response()}