Enum mwapi_errors::Error [−][src]
#[non_exhaustive]
pub enum Error {
Show 33 variants
HttpError(Error),
InvalidHeaderValue(InvalidHeaderValue),
JsonError(Error),
LockError(AcquireError),
InvalidTitle(Error),
InvalidEtag,
BadToken,
TokenError(String),
InvalidHeadingLevel(u32),
NotLoggedIn,
NotLoggedInAsBot,
PermissionsError(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(String),
ContentTooBig(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
HttpError(Error)
Tuple Fields
0: ErrorA HTTP error like a 4XX or 5XX status code
InvalidHeaderValue(InvalidHeaderValue)
Tuple Fields
Invalid header value, likely if the provided OAuth2 token or User-agent are invalid
JsonError(Error)
Tuple Fields
0: ErrorError when decoding the JSON response from the API
LockError(AcquireError)
Tuple Fields
0: AcquireErrorError if unable to get request concurrency lock
InvalidTitle(Error)
Tuple Fields
0: ErrorInvalidEtag
etag header is invalid/missing
BadToken
Token invalid or expired
TokenError(String)
Tuple Fields
0: StringUnable to fetch a CSRF token
InvalidHeadingLevel(u32)
Tuple Fields
0: u32NotLoggedIn
When expected to be logged in but aren’t
NotLoggedInAsBot
When expected to be logged in but aren’t
PermissionsError(String)
Tuple Fields
0: StringBlocked
PartiallyBlocked
GloballyBlocked(String)
Tuple Fields
0: StringGloballyRangeBlocked(String)
Tuple Fields
0: StringGloballyXFFBlocked(String)
Tuple Fields
0: StringUnknownBlock(String)
Tuple Fields
0: StringWhen we can’t group it into a more specific block
LoginThrottled
WrongPassword
InvalidPage
Nobots
When {{nobots}} matches
PageDoesNotExist(String)
Tuple Fields
0: StringPage does not exist
ProtectedPage
Page is protected
EditConflict(String)
Tuple Fields
0: StringEdit conflict (string field is deprecated)
ContentTooBig(String)
Tuple Fields
0: StringSpamFilter
Tripped the spam filter (aka SpamBlacklist)
UnknownSaveFailure(Value)
Tuple Fields
0: ValueSome save failure happened, but we don’t know what it is
MaxlagError
Readonly(String)
Tuple Fields
0: StringWhen MediaWiki is in readonly mode
InternalError(ApiError)
Tuple Fields
0: ApiErrorAn internal MediaWiki exception
ApiError(ApiError)
Tuple Fields
0: ApiErrorAny arbitrary error returned by the MediaWiki API
UnknownError(String)
Tuple Fields
0: StringAn error where we don’t know what to do nor have information to report back
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
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more
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
