View Source Nostrum.Error.ApiError exception (Nostrum v0.9.0)

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

@type detailed_error() :: %{
  code: discord_status_code(),
  message: String.t(),
  errors: errors()
}
@type discord_status_code() :: 10001..90001
@type error() :: %{code: discord_status_code(), message: String.t()}
@type error_list_map() :: %{_errors: [error()]}
@type errors() ::
  %{required(String.t()) => errors()}
  | %{required(String.t()) => error_list_map()}
@type response() :: String.t() | error() | detailed_error()
@type status_code() :: 100..511
@type t() :: %{status_code: status_code(), response: response()}