crux_rest v0.1.3 Crux.Rest.ApiError exception View Source
Represents a Discord API error.
Raised or returned whenever the api responded with a non 200
/ 204
status code
Link to this section Summary
Types
Property | Description | Example(s) |
---|---|---|
status_code | HTTP status code | 400 , 404 , 403 |
code | See Discord’s JSON Error Codes | 10006 , 90001 |
message | Message describing the error | Unknown Invite |
path | Path of the request | /invites/broken |
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
Callback implementation for Exception.message/1
Link to this section Types
Property | Description | Example(s) |
---|---|---|
status_code | HTTP status code | 400 , 404 , 403 |
code | See Discord’s JSON Error Codes | 10006 , 90001 |
message | Message describing the error | Unknown Invite |
path | Path of the request | /invites/broken |
Link to this section Functions
Link to this function
exception(msg)
View Source
exception(message :: String.t()) :: Crux.Rest.ApiError.t()
Default implementation only providing a message
for raise/2
Link to this function
exception(error, status_code, path, method)
View Source
exception( error :: map(), status_code :: pos_integer(), path :: String.t(), method :: String.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.
Callback implementation for Exception.message/1
.