Enum serenity::Error [] [src]

pub enum Error {
    Decode(&'static strValue),
    Format(FormatError),
    Io(IoError),
    Json(JsonError),
    Model(ModelError),
    Num(ParseIntError),
    Other(&'static str),
    Url(String),
    Client(ClientError),
    Gateway(GatewayError),
    Http(HttpError),
    Hyper(HyperError),
    Tls(TlsError),
    WebSocket(WebSocketError),
}

A common error enum returned by most of the library's functionality within a custom Result.

The most common error types, the ClientError and GatewayError enums, are both wrapped around this in the form of the Client and Gateway variants.

Variants

An error while decoding a payload.

There was an error with a format.

An std::io error.

An error from the serde_json crate.

An error from the model module.

An error occurred while parsing an integer.

Some other error. This is only used for "Expected value " errors, when a more detailed error can not be easily provided via the Error::Decode variant.

An error from the url crate.

A client error.

An error from the gateway module.

An error from the http module.

An error from the hyper crate.

An error from the native-tls crate.

An error from the rust-websocket crate.

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter.

impl From<FormatError> for Error
[src]

Performs the conversion.

impl From<GatewayError> for Error
[src]

Performs the conversion.

impl From<HyperError> for Error
[src]

Performs the conversion.

impl From<IoError> for Error
[src]

Performs the conversion.

impl From<JsonError> for Error
[src]

Performs the conversion.

impl From<ParseIntError> for Error
[src]

Performs the conversion.

impl From<ModelError> for Error
[src]

Performs the conversion.

impl From<TlsError> for Error
[src]

Performs the conversion.

impl From<WebSocketError> for Error
[src]

Performs the conversion.

impl Display for Error
[src]

Formats the value using the given formatter. Read more

impl StdError for Error
[src]

A short description of the error. Read more

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