Enum serenity::prelude::SerenityError
[−]
[src]
pub enum SerenityError {
Decode(&'static str, Value),
Format(FormatError),
Io(IoError),
Json(JsonError),
Model(ModelError),
Num(ParseIntError),
ExceededLimit(String, u32),
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
Decode(&'static str, Value)An error while decoding a payload.
Format(FormatError)There was an error with a format.
Io(IoError)An std::io error.
Json(JsonError)An error from the serde_json crate.
Model(ModelError)An error from the model module.
Num(ParseIntError)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".
Other(&'static str)Some other error. This is only used for "Expected value Error::Decode variant.
Url(String)An error from the url crate.
Client(ClientError)A client error.
Gateway(GatewayError)An error from the gateway module.
Http(HttpError)An error from the http module.
Hyper(HyperError)An error from the hyper crate.
Tls(TlsError)An error from the native-tls crate.
WebSocket(WebSocketError)An error from the rust-websocket crate.
Trait Implementations
impl Debug for Error[src]
impl From<FormatError> for Error[src]
fn from(e: FormatError) -> Error[src]
Performs the conversion.
impl From<GatewayError> for Error[src]
fn from(e: GatewayError) -> Error[src]
Performs the conversion.
impl From<HyperError> for Error[src]
fn from(e: HyperError) -> Error[src]
Performs the conversion.
impl From<IoError> for Error[src]
impl From<JsonError> for Error[src]
impl From<ParseIntError> for Error[src]
fn from(e: ParseIntError) -> Error[src]
Performs the conversion.
impl From<ModelError> for Error[src]
fn from(e: ModelError) -> Error[src]
Performs the conversion.
impl From<TlsError> for Error[src]
impl From<WebSocketError> for Error[src]
fn from(e: WebSocketError) -> Error[src]
Performs the conversion.
impl Display for Error[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more