crux_rest v0.2.2 Crux.Rest.ApiError exception View Source
Represents a Discord API error.
Raised or returned whenever the api responded with a non 2xx
status code
Link to this section Summary
Types
Property | Description | Example(s) |
---|---|---|
status_code | HTTP status code | 403 , 404 , 400 |
code | JSON Error CodesSee Discord's | 90001 , 10006 |
message | Message describing the error | Unknown Invite |
path | Path of the request | /invites/broken |
method | HTTP verb | :get, :post, :patch |
Functions
Default implementation only providing a message
for raise/2
Creates a full Crux.Rest.ApiError
struct, returned / raised by all Crux.Rest
functions in case of an API error.
Link to this section Types
Specs
t() :: %Crux.Rest.ApiError{ __exception__: true, code: integer() | nil, message: String.t(), method: atom(), path: String.t(), status_code: integer() }
Property | Description | Example(s) |
---|---|---|
status_code | HTTP status code | 403 , 404 , 400 |
code | JSON Error CodesSee Discord's | 90001 , 10006 |
message | Message describing the error | Unknown Invite |
path | Path of the request | /invites/broken |
method | HTTP verb | :get, :post, :patch |
Link to this section Functions
Specs
exception(message :: binary()) :: Exception.t()
Default implementation only providing a message
for raise/2
Specs
exception(Crux.Rest.Request.t(), HTTPoison.Response.t()) :: Crux.Rest.ApiError.t()
Creates a full Crux.Rest.ApiError
struct, returned / raised by all Crux.Rest
functions in case of an API error.