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), Collector(CollectorError), Gateway(GatewayError), Http(Box<HttpError>), 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
An error while decoding a payload.
There was an error with a format.
Tuple Fields of Format
0: FormatError
An std::io
error.
Tuple Fields of Io
0: IoError
An error from the serde_json
crate.
Tuple Fields of Json
0: JsonError
An error from the model
module.
Tuple Fields of Model
0: ModelError
An error occurred while parsing an integer.
Tuple Fields of Num
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”.
The input is not in the specified range.
Returned by GuildId::members
, Guild::members
and PartialGuild::members
(param_name, value, range_min, range_max)
Some other error. This is only used for “Expected value Error::Decode
variant.
Tuple Fields of Other
0: &'static str
An error from the url
crate.
Tuple Fields of Url
0: String
A client error.
Tuple Fields of Client
0: ClientError
A collector error.
Tuple Fields of Collector
An error from the gateway
module.
Tuple Fields of Gateway
0: GatewayError
An error from the http
module.
An error from the tungstenite
crate.
Trait Implementations
Performs the conversion.
Performs the conversion.