Enum backblaze_b2::B2Error [] [src]

pub enum B2Error {
    HyperError(Error),
    IOError(Error),
    JsonError(Error),
    B2Error(StatusCodeB2ErrorMessage),
    ApiInconsistency(String),
}

An error caused while using any of the B2 apis. Errors returned by the b2 api are stored exactly as received from backblaze and for ease of use several methods are provided on this type in order to check the kind of error.

The following methods are relevant for any backblaze api call: is_service_unavilable, is_too_many_requests, should_obtain_new_authentication, should_back_off.

The following methods are relevant for any backblaze api call beside authentication: is_expired_authentication, is_authorization_issue.

Since these errors are so common, they are not mentioned directly in the documentation for the api-call.

Variants

When the b2 website returns an error, it is stored in this variant.

This type is only returned if the b2 website is not following the api spec.

Methods

impl B2Error
[src]

Load errors

Returns true if the issue is related to the backblaze server being under too much load.

Returns true if we are making too many requests.

Returns true if we should obtain new authentication. This returns true if either the connection failed or the authentication has expired. The reason for obtaining new authentication if the connection failed is that this allows you to connect to some other backblaze pod, which might be better connected.

Returns true if you should be using some sort of exponential back off for future requests.

impl B2Error
[src]

Authorization errors

Returns true if the error is related to invalid credentials during authentication.

Returns true if the error is caused by the authentication being expired. Consider using the method should_obtain_new_authentication instead.

Returns true if the error is caused by any issue related to the authorization token, including expired authentication tokens and invalid authorization tokens.

impl B2Error
[src]

File errors

Returns true if the error is caused by a file name which is not allowed on the b2 server.

Returns true if the error is related to a file that was not found.

Returns true if the error is caused by an attempt to hide a hidden file.

Returns true if the error is caused by a request to download an interval of a file that is out of bounds.

impl B2Error
[src]

Bucket errors

Returns true if the error is caused by the account having reached the maximum bucket count.

Returns true if the error is caused by an attempt to create a bucket with a name of a pre-existing bucket.

Returns true if the error is caused by an attempt to create a bucket with a name which is not allowed.

Returns true if the error is caused by requests to interact with buckets that do not exist.

impl B2Error
[src]

Various errors

Returns true if a request used a ifRevisionIs header and the test failed.

Returns true if the usage cap on backblaze b2 has been exceeded.

Returns true if the error is caused by interacting with snapshot buckets in ways not allowed.

Returns true if the issue is regarding an invalid file prefix.

Returns true if the issue is an invalid path delimiter.

Trait Implementations

impl Debug for B2Error
[src]

Formats the value using the given formatter.

impl From<Error> for B2Error
[src]

Performs the conversion.

impl From<Error> for B2Error
[src]

Performs the conversion.

impl From<ParseError> for B2Error
[src]

Performs the conversion.

impl From<Error> for B2Error
[src]

Performs the conversion.

impl Display for B2Error
[src]

Formats the value using the given formatter. Read more