Enum dasi::Error [] [src]

pub enum Error {
    Hyper(HyperError),
    Json(JsonError),
    WebSocket(WebSocketError),
    Io(IoError),
    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

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

fn from(err: IoError) -> Error

impl From<HyperError> for Error

fn from(err: HyperError) -> Error

impl From<JsonError> for Error

fn from(err: JsonError) -> Error

impl From<WebSocketError> for Error

fn from(err: WebSocketError) -> Error

impl Display for Error

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

impl StdError for Error

fn description(&self) -> &str

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

Derived Implementations

impl Debug for Error

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