Enum discord::Error [] [src]

pub enum Error {
    Hyper(HyperError),
    Json(JsonError),
    WebSocket(WebSocketError),
    Io(IoError),
    Opus(OpusError),
    Closed(Option<u16>, Vec<u8>),
    Decode(&'static str, Value),
    Status(StatusCode, Option<Value>),
    RateLimited(u64),
    Protocol(&'static str),
    Other(&'static str),
}

Discord API error type.

Variants

Hyper

A hyper crate error

Json

A serde_json crate error

WebSocket

A websocket crate error

Io

A std::io module error

Opus

An error in the Opus library, with the function name and error code

Closed

A websocket connection was closed, possibly with a message

Decode

A json decoding error, with a description and the offending value

Status

A generic non-success response from the REST API

RateLimited

A rate limit error, with how many milliseconds to wait before retrying

Protocol

A Discord protocol error, with a description

Other

A miscellaneous error, with a description

Trait Implementations

impl From<IoError> for Error
[src]

fn from(err: IoError) -> Error

Performs the conversion.

impl From<HyperError> for Error
[src]

fn from(err: HyperError) -> Error

Performs the conversion.

impl From<JsonError> for Error
[src]

fn from(err: JsonError) -> Error

Performs the conversion.

impl From<WebSocketError> for Error
[src]

fn from(err: WebSocketError) -> Error

Performs the conversion.

impl From<OpusError> for Error
[src]

fn from(err: OpusError) -> Error

Performs the conversion.

impl From<BoError> for Error
[src]

fn from(err: BoError) -> Error

Performs the conversion.

impl Display for Error
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl StdError for Error
[src]

fn description(&self) -> &str

A short description of the error. Read more

fn cause(&self) -> Option<&StdError>

The lower-level cause of this error, if any.

Derived Implementations

impl Debug for Error
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.