pub enum APIError {
Show 16 variants
ClientNotReady,
FailedGetIP(String),
LoginFailed(String),
RequestFailed(Error),
InvalidHeader(InvalidHeaderValue),
BadUrl(ParseError),
BadParameters,
AccessDenied,
NotFound,
RequestThrottled,
UnknownError,
InMaintenance,
BadResponse(String, StatusCode),
InvalidParameters(String),
InvalidTag(String),
EventFailure(String),
}
Variants
ClientNotReady
API hasn’t been initialized yet (logging in + making keys).
FailedGetIP(String)
Failed to query the current ip address.
LoginFailed(String)
Failed to login to an account, either due to invalid credentials or a server error.
RequestFailed(Error)
Reqwest error
InvalidHeader(InvalidHeaderValue)
Invalid Header, should never happen
BadUrl(ParseError)
Failed to parse a URL, should never happen
BadParameters
Status code of 400
AccessDenied
Status code of 403
NotFound
Status code of 404
RequestThrottled
Status code of 429
UnknownError
Status code of 500
InMaintenance
Status code of 503
BadResponse(String, StatusCode)
All other cases (edge cases/unknown status codes)
InvalidParameters(String)
From malformed cursors or using invalid leagues
InvalidTag(String)
EventFailure(String)
Trait Implementations
sourceimpl Error for APIError
impl Error for APIError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
sourceimpl From<InvalidHeaderValue> for APIError
impl From<InvalidHeaderValue> for APIError
sourcefn from(e: InvalidHeaderValue) -> Self
fn from(e: InvalidHeaderValue) -> Self
Converts to this type from the input type.
sourceimpl From<LogicLongError> for APIError
impl From<LogicLongError> for APIError
sourcefn from(e: LogicLongError) -> Self
fn from(e: LogicLongError) -> Self
Converts to this type from the input type.
sourceimpl From<ParseError> for APIError
impl From<ParseError> for APIError
sourcefn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for APIError
impl Send for APIError
impl Sync for APIError
impl Unpin for APIError
impl !UnwindSafe for APIError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more