pub enum Error<E = NoError> {
Api(E),
HttpClient(Box<dyn Error + Send + Sync + 'static>),
Json(Error),
UnexpectedResponse(String),
BadRequest(String),
Authentication(AuthError),
RateLimited {
reason: RateLimitReason,
retry_after_seconds: u32,
},
AccessDenied(AccessError),
ServerError(String),
UnexpectedHttpError {
code: u16,
response: String,
},
}
Expand description
An error occurred in the process of making an API call. This is different from the case where your call succeeded, but the operation returned an error.
Variants§
Api(E)
An error returned by the API. Its type depends on the endpoint being called.
HttpClient(Box<dyn Error + Send + Sync + 'static>)
Some error from the internals of the HTTP client.
Json(Error)
Something went wrong in the process of transforming your arguments into a JSON string.
UnexpectedResponse(String)
The Dropbox API response was unexpected or malformed in some way.
BadRequest(String)
The Dropbox API indicated that your request was malformed in some way.
Authentication(AuthError)
Errors occurred during authentication.
RateLimited
Your request was rejected due to rate-limiting. You can retry it later.
Fields
reason: RateLimitReason
The server-given reason for the rate-limiting.
AccessDenied(AccessError)
The user or team account doesn’t have access to the endpoint or feature.
ServerError(String)
The Dropbox API server had an internal error.
UnexpectedHttpError
The Dropbox API returned an unexpected HTTP response code.
Implementations§
Source§impl<E: Error + 'static> Error<E>
impl<E: Error + 'static> Error<E>
Sourcepub fn downcast_ref_inner<E2: Error + 'static>(&self) -> Option<&E2>
pub fn downcast_ref_inner<E2: Error + 'static>(&self) -> Option<&E2>
Look for an inner error of the given type anywhere within this error, by walking the chain
of std::error::Error::source
recursively until something matches the desired type.
Source§impl<E: Error + Send + Sync + 'static> Error<E>
impl<E: Error + Send + Sync + 'static> Error<E>
Sourcepub fn boxed(self) -> BoxedError
pub fn boxed(self) -> BoxedError
Change the concretely-typed API error, if any, into a boxed trait object.
This makes it possible to combine dissimilar errors into one type, which can be broken out
later using
std::error::Error::downcast_ref
if desired.
Source§impl Error<NoError>
impl Error<NoError>
Sourcepub fn typed<E>(self) -> Error<E>
pub fn typed<E>(self) -> Error<E>
Lift an error with no possible API error value to a typed error of any type.
Ideally this would just be impl<E> From<Error<NoError>> for Error<E>
but that conflicts
with the reflexive conversion (E could be NoError), and Rust doesn’t have negative type
bounds or specialization, so it has to be this method instead.
Trait Implementations§
Source§impl<E> Error for Error<E>
impl<E> Error for Error<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<RequestError> for Error
Available on crate feature default_client
only.
impl From<RequestError> for Error
default_client
only.