pub enum Error {
AuthRequired,
AuthFailed,
NotFound {
kind: &'static str,
reference: String,
},
Timeout(u64),
Network(String),
RateLimited {
retry_after: Option<u64>,
message: String,
},
Api {
status: u16,
message: String,
body: Option<Value>,
},
InvalidUrl(String),
Decode(String),
Builder(String),
}Variants§
AuthRequired
No credentials were supplied for a request that needs them.
AuthFailed
Credentials were supplied but rejected (401/403).
NotFound
The server answered 404 for the requested resource.
Timeout(u64)
The request did not complete within the configured timeout.
Network(String)
DNS, TLS or connection level failure.
RateLimited
The server asked us to slow down (429), optionally saying for how long.
Api
Any other non-success HTTP status.
InvalidUrl(String)
The configured host could not be turned into a usable base URL.
Decode(String)
The response body was not the JSON we expected.
Builder(String)
The client itself could not be constructed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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()
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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