Enum mwapi_errors::Error[][src]

#[non_exhaustive]
pub enum Error {
Show 27 variants HttpError(Error), InvalidHeaderValue(InvalidHeaderValue), JsonError(Error), LockError(AcquireError), InvalidEtag, BadToken, TokenError(String), InvalidHeadingLevel(u32), NotLoggedIn, NotLoggedInAsBot, PermissionsError(String), GloballyBlocked(String), GloballyRangeBlocked(String), GloballyXFFBlocked(String), LoginThrottled, WrongPassword, Nobots, PageDoesNotExist(String), ProtectedPage, EditConflict(String), SpamFilter { info: String, matches: Vec<String>, }, UnknownSaveFailure(Value), MaxlagError { info: String, retry_after: u32, }, Readonly(String), InternalError(ApiError), ApiError(ApiError), UnknownError(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.
HttpError(Error)

A HTTP error like a 4XX or 5XX status code

Tuple Fields of HttpError

0: Error
InvalidHeaderValue(InvalidHeaderValue)

Invalid header value, likely if the provided OAuth2 token or User-agent are invalid

Tuple Fields of InvalidHeaderValue

0: InvalidHeaderValue
JsonError(Error)

Error when decoding the JSON response from the API

Tuple Fields of JsonError

0: Error
LockError(AcquireError)

Error if unable to get request concurrency lock

Tuple Fields of LockError

0: AcquireError
InvalidEtag

etag header is invalid/missing

BadToken

Token invalid or expired

TokenError(String)

Unable to fetch a CSRF token

Tuple Fields of TokenError

0: String
InvalidHeadingLevel(u32)

Tuple Fields of InvalidHeadingLevel

0: u32
NotLoggedIn

When expected to be logged in but aren’t

NotLoggedInAsBot

When expected to be logged in but aren’t

PermissionsError(String)

Tuple Fields of PermissionsError

0: String
GloballyBlocked(String)

Tuple Fields of GloballyBlocked

0: String
GloballyRangeBlocked(String)

Tuple Fields of GloballyRangeBlocked

0: String
GloballyXFFBlocked(String)

Tuple Fields of GloballyXFFBlocked

0: String
LoginThrottled
WrongPassword
Nobots

When {{nobots}} matches

PageDoesNotExist(String)

Page does not exist

Tuple Fields of PageDoesNotExist

0: String
ProtectedPage

Page is protected

EditConflict(String)

Edit conflict

Tuple Fields of EditConflict

0: String
SpamFilter

Tripped the spam filter (aka SpamBlacklist)

Fields of SpamFilter

info: Stringmatches: Vec<String>
UnknownSaveFailure(Value)

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

Tuple Fields of UnknownSaveFailure

0: Value
MaxlagError

Fields of MaxlagError

info: Stringretry_after: u32
Readonly(String)

When MediaWiki is in readonly mode

Tuple Fields of Readonly

0: String
InternalError(ApiError)

An internal MediaWiki exception

Tuple Fields of InternalError

0: ApiError
ApiError(ApiError)

Any arbitrary error returned by the MediaWiki API

Tuple Fields of ApiError

0: ApiError
UnknownError(String)

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

Tuple Fields of UnknownError

0: String

Implementations

Whether the issue is related to saving a page

Whether the issue is related to a block

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

Trait Implementations

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.

Performs the conversion.

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more