Elixir v0.2.0 Nostrum.Error.ApiError exception

Represents a failed response from the API.

This occurs when hackney or HTTPoison fail, or when the API doesn’t respond with 200 or 204. This should only occur when using the banged API methods.

Summary

Types

t()

Map representing the error returned by an API call

Functions

Callback implementation for Exception.exception/1

Callback implementation for Exception.message/1

Types

message_map()
message_map() :: %{code: String.t, message: String.t}
t()
t() :: %{status_code: integer | nil, message: String.t | message_map}

Map representing the error returned by an API call.

  • status_code

    • nil if HTTPoison or Hackney throws an error.
    • Status code of response otherwise.
  • message

    • Error message of response. If the error is from the Discord API, this will be a map containing the keys code and message as strings.

Functions

exception(msg)
exception(String.t) :: Exception.t
exception(Keyword.t) :: Exception.t

Callback implementation for Exception.exception/1.

message(exception)
message(Exception.t) :: String.t

Callback implementation for Exception.message/1.