#[non_exhaustive]pub enum OsuError {
Show 16 variants
BodyError {
source: HttpError,
},
BuilderMissingId,
BuilderMissingSecret,
ChunkingResponse {
source: HyperError,
},
CreatingTokenHeader {
source: InvalidHeaderValue,
},
NotFound,
NoToken,
Parsing {
body: String,
source: SerdeError,
},
ParsingValue {
source: ParsingError,
},
Request {
source: HyperError,
},
RequestTimeout,
Response {
body: String,
source: ApiError,
status: StatusCode,
},
ServiceUnavailable(String),
UnavailableEndpoint,
UpdateToken {
source: Box<OsuError>,
},
Url {
source: ParseError,
url: String,
},
}
Expand description
The main error type
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
BodyError
Failed to create a request body
BuilderMissingId
Failed to build an Osu
client because no client id was provided
BuilderMissingSecret
Failed to build an Osu
client because no client secret was provided
ChunkingResponse
Fields
§
source: HyperError
Error while handling response from the API
CreatingTokenHeader
Fields
§
source: InvalidHeaderValue
Failed to create the token header for a request
NotFound
The API returned a 404
NoToken
Attempted to make request without valid token
Parsing
Failed to deserialize response
ParsingValue
Fields
§
source: ParsingError
Failed to parse a value
Request
Fields
§
source: HyperError
Failed to send request
RequestTimeout
Timeout while requesting from API
Response
API returned an error
Temporal (?) downtime of the osu API
The client’s authentication is not sufficient for the endpoint
UpdateToken
Failed to update token
Url
Failed to parse the URL for a request
Trait Implementations§
source§impl Error for OsuError
impl Error for OsuError
source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ParsingError> for OsuError
impl From<ParsingError> for OsuError
source§fn from(e: ParsingError) -> Self
fn from(e: ParsingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for OsuError
impl Send for OsuError
impl Sync for OsuError
impl Unpin for OsuError
impl !UnwindSafe for OsuError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more