Enum serenity::prelude::SerenityError [−][src]
#[non_exhaustive]
pub enum SerenityError {
Show 15 variants
Decode(&'static str, Value),
Format(FormatError),
Io(IoError),
Json(JsonError),
Model(ModelError),
Num(ParseIntError),
ExceededLimit(String, u32),
NotInRange(&'static str, u64, u64, u64),
Other(&'static str),
Url(String),
Client(ClientError),
Gateway(GatewayError),
Http(Box<HttpError>),
Rustls(RustlsError),
Tungstenite(TungsteniteError),
}
Expand description
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 Self::Client
and
Self::Gateway
variants.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Decode(&'static str, Value)
An error while decoding a payload.
Format(FormatError)
Tuple Fields
0: FormatError
There was an error with a format.
Io(IoError)
Tuple Fields
0: IoError
An std::io
error.
Json(JsonError)
Tuple Fields
0: JsonError
An error from the serde_json
crate.
Model(ModelError)
Tuple Fields
0: ModelError
An error from the model
module.
Num(ParseIntError)
Tuple Fields
An error occurred while parsing an integer.
ExceededLimit(String, u32)
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”.
NotInRange(&'static str, u64, u64, u64)
The input is not in the specified range.
Returned by GuildId::members
, Guild::members
and PartialGuild::members
(param_name, value, range_min, range_max)
Other(&'static str)
Tuple Fields
0: &'static str
Some other error. This is only used for “Expected value Error::Decode
variant.
Url(String)
Tuple Fields
0: String
An error from the url
crate.
Client(ClientError)
Tuple Fields
0: ClientError
A client error.
Gateway(GatewayError)
Tuple Fields
0: GatewayError
An error from the gateway
module.
Http(Box<HttpError>)
An error from the http
module.
Rustls(RustlsError)
An error occuring in rustls
Tungstenite(TungsteniteError)
Tuple Fields
An error from the tungstenite
crate.
Trait Implementations
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more