Enum serenity::Error[][src]

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

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.

Input exceeded a limit. Providing the input and the limit that's not supposed to be exceeded.

This only exists for the GuildId::ban and Member::ban functions. For their cases, it's the "reason".

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.

An error from the opus crate.

Indicating an error within the voice module.

Trait Implementations

impl Debug for Error
[src]

Formats the value using the given formatter. Read more

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<OpusError> 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]

This method is soft-deprecated. Read more

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

Auto Trait Implementations

impl Send for Error

impl !Sync for Error