Enum mastodon_async::errors::Error
source · pub enum Error {
Show 21 variants
Api {
status: StatusCode,
response: ApiError,
},
Serde(Error),
UrlEncoded(Error),
Http(Error),
Io(Error),
Url(ParseError),
ClientIdRequired,
ClientSecretRequired,
AccessTokenRequired,
MissingField(&'static str),
TomlSer(Error),
TomlDe(Error),
NotAllBytesWritten,
HeaderStrError(ToStrError),
LinkHeaderParse(Error),
UnrecognizedRel {
rel: String,
link: String,
},
Envy(Error),
IntConversion(TryFromIntError),
Entities(Error),
FromUtf8(FromUtf8Error),
Other(String),
}
Expand description
enum of possible errors encountered using the mastodon API.
Variants§
Api
Fields
status: StatusCode
The response status.
Error from the Mastodon API. This typically means something went wrong with your authentication or data.
Serde(Error)
Error deserialising to json. Typically represents a breaking change in the Mastodon API
UrlEncoded(Error)
Error serializing to url-encoded string
Http(Error)
Error encountered in the HTTP backend while requesting a route.
Io(Error)
Wrapper around the std::io::Error
struct.
Url(ParseError)
Wrapper around the url::ParseError
struct.
ClientIdRequired
Missing Client Id.
ClientSecretRequired
Missing Client Secret.
AccessTokenRequired
Missing Access Token.
MissingField(&'static str)
MastodonBuilder & AppBuilder error
TomlSer(Error)
Error serializing to toml
TomlDe(Error)
Error deserializing from toml
NotAllBytesWritten
Error raised in the helpers::json::to_writer or helpers::toml::to_writer function if not all bytes were written to the writer
HeaderStrError(ToStrError)
Error converting an http header to a string
LinkHeaderParse(Error)
Error parsing the http Link header
UnrecognizedRel
Error returned when an unexpected rel was parsed.
Envy(Error)
Error deserializing config from the environment
IntConversion(TryFromIntError)
An integer conversion was attempted, but the value didn’t fit into the target type.
At the time of writing, this can only be triggered when a file is larger than the system’s usize allows.
Entities(Error)
Error from mastodon-async-entities
FromUtf8(FromUtf8Error)
Error parsing UTF-8 string from bytes
Other(String)
Other errors
Implementations§
source§impl Error
impl Error
§enum
Variant Predicates
sourcepub fn is_url_encoded(&self) -> bool
pub fn is_url_encoded(&self) -> bool
Is this Error
a UrlEncoded
?
sourcepub fn is_client_id_required(&self) -> bool
pub fn is_client_id_required(&self) -> bool
Is this Error
a ClientIdRequired
?
sourcepub fn is_client_secret_required(&self) -> bool
pub fn is_client_secret_required(&self) -> bool
Is this Error
a ClientSecretRequired
?
sourcepub fn is_access_token_required(&self) -> bool
pub fn is_access_token_required(&self) -> bool
Is this Error
a AccessTokenRequired
?
sourcepub fn is_missing_field(&self) -> bool
pub fn is_missing_field(&self) -> bool
Is this Error
a MissingField
?
sourcepub fn is_toml_ser(&self) -> bool
pub fn is_toml_ser(&self) -> bool
Is this Error
a TomlSer
?
sourcepub fn is_toml_de(&self) -> bool
pub fn is_toml_de(&self) -> bool
Is this Error
a TomlDe
?
sourcepub fn is_not_all_bytes_written(&self) -> bool
pub fn is_not_all_bytes_written(&self) -> bool
Is this Error
a NotAllBytesWritten
?
sourcepub fn is_header_str_error(&self) -> bool
pub fn is_header_str_error(&self) -> bool
Is this Error
a HeaderStrError
?
sourcepub fn is_link_header_parse(&self) -> bool
pub fn is_link_header_parse(&self) -> bool
Is this Error
a LinkHeaderParse
?
sourcepub fn is_unrecognized_rel(&self) -> bool
pub fn is_unrecognized_rel(&self) -> bool
Is this Error
a UnrecognizedRel
?
sourcepub fn is_int_conversion(&self) -> bool
pub fn is_int_conversion(&self) -> bool
Is this Error
a IntConversion
?
sourcepub fn is_entities(&self) -> bool
pub fn is_entities(&self) -> bool
Is this Error
a Entities
?
sourcepub fn is_from_utf8(&self) -> bool
pub fn is_from_utf8(&self) -> bool
Is this Error
a FromUtf8
?