Enum mwapi_errors::Error[][src]

#[non_exhaustive]
pub enum Error {
Show 29 variants InvalidJson(Arc<Error>), InvalidEtag, BadToken, TokenFailure(String), InvalidHeadingLevel(u32), NotLoggedIn, NotLoggedInAsBot, PermissionDenied(String), Blocked { info: String, details: BlockDetails, }, PartiallyBlocked { info: String, details: BlockDetails, }, GloballyBlocked(String), GloballyRangeBlocked(String), GloballyXFFBlocked(String), UnknownBlock(String), LoginThrottled, WrongPassword, InvalidPage, Nobots, PageDoesNotExist(String), ProtectedPage, EditConflict, ContentTooBig(String), SpamFilter { info: String, matches: Vec<String>, }, UnknownSaveFailure(Value), Maxlag(String), Readonly(String), InternalException(ApiError), ApiError(ApiError), Unknown(String),
}
Expand description

Primary error class

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.

InvalidJson(Arc<Error>)

Tuple Fields

0: Arc<Error>

Error when decoding the JSON response from the API

InvalidEtag

etag header is invalid/missing

BadToken

Token invalid or expired

TokenFailure(String)

Tuple Fields

0: String

Unable to fetch a CSRF token

InvalidHeadingLevel(u32)

Tuple Fields

0: u32

NotLoggedIn

When expected to be logged in but aren’t

NotLoggedInAsBot

When expected to be logged in but aren’t

PermissionDenied(String)

Tuple Fields

0: String

Blocked

Fields

info: String
details: BlockDetails

PartiallyBlocked

Fields

info: String
details: BlockDetails

GloballyBlocked(String)

Tuple Fields

0: String

GloballyRangeBlocked(String)

Tuple Fields

0: String

GloballyXFFBlocked(String)

Tuple Fields

0: String

UnknownBlock(String)

Tuple Fields

0: String

When we can’t group it into a more specific block

LoginThrottled

WrongPassword

InvalidPage

Nobots

When {{nobots}} matches

PageDoesNotExist(String)

Tuple Fields

0: String

Page does not exist

ProtectedPage

Page is protected

EditConflict

Edit conflict

ContentTooBig(String)

Tuple Fields

0: String

SpamFilter

Fields

info: String
matches: Vec<String>

Tripped the spam filter (aka SpamBlacklist)

UnknownSaveFailure(Value)

Tuple Fields

0: Value

Some save failure happened, but we don’t know what it is

Maxlag(String)

Tuple Fields

0: String

Readonly(String)

Tuple Fields

0: String

When MediaWiki is in readonly mode

InternalException(ApiError)

Tuple Fields

An internal MediaWiki exception

ApiError(ApiError)

Tuple Fields

Any arbitrary error returned by the MediaWiki API

Unknown(String)

Tuple Fields

0: String

An error where we don’t know what to do nor have information to report back

Implementations

Whether the issue is related to a specific page rather than a global issue

Whether the issue is related to a sitewide block

Whether the request should be retried, after some suitable backoff and likely with some retry limit

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.