#[non_exhaustive]pub enum Error {
Show 37 variants
HttpError(Error),
InvalidHeaderValue(InvalidHeaderValue),
InvalidJson(Error),
LockFailure(AcquireError),
InvalidTitle(Error),
IoError(Error),
TooManyRequests {
retry_after: Option<u64>,
},
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>,
},
UndoFailure(String),
UnknownSaveFailure(Value),
UploadWarning(Vec<UploadWarning>),
Maxlag {
info: String,
retry_after: Option<u64>,
},
Readonly {
info: String,
retry_after: Option<u64>,
},
InternalException(ApiError),
ApiError(ApiError),
Unknown(String),
}
Expand description
Primary error class
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HttpError(Error)
A HTTP error like a 4XX or 5XX status code
InvalidHeaderValue(InvalidHeaderValue)
Invalid header value, likely if the provided OAuth2 token or User-agent are invalid
InvalidJson(Error)
Error when decoding the JSON response from the API
LockFailure(AcquireError)
Error if unable to get request concurrency lock
InvalidTitle(Error)
IoError(Error)
TooManyRequests
A HTTP error with 429 status code
InvalidEtag
etag header is invalid/missing
BadToken
Token invalid or expired
TokenFailure(String)
Unable to fetch a CSRF token
InvalidHeadingLevel(u32)
NotLoggedIn
When expected to be logged in but aren’t
NotLoggedInAsBot
When expected to be logged in but aren’t
PermissionDenied(String)
Blocked
PartiallyBlocked
GloballyBlocked(String)
GloballyRangeBlocked(String)
GloballyXFFBlocked(String)
UnknownBlock(String)
When we can’t group it into a more specific block
LoginThrottled
WrongPassword
InvalidPage
Nobots
When {{nobots}} matches
PageDoesNotExist(String)
Page does not exist
ProtectedPage
Page is protected
EditConflict
Edit conflict
ContentTooBig(String)
SpamFilter
Tripped the spam filter (aka SpamBlacklist)
UndoFailure(String)
If the edit could not be undone
UnknownSaveFailure(Value)
Some save failure happened, but we don’t know what it is
UploadWarning(Vec<UploadWarning>)
Maxlag
Readonly
When MediaWiki is in readonly mode
InternalException(ApiError)
An internal MediaWiki exception
ApiError(ApiError)
Any arbitrary error returned by the MediaWiki API
Unknown(String)
An error where we don’t know what to do nor have information to report back
Implementations§
source§impl Error
impl Error
Whether the issue is related to a specific page rather than a global issue
sourcepub fn is_sitewide_block(&self) -> bool
pub fn is_sitewide_block(&self) -> bool
Whether the issue is related to a sitewide block
sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
If the error merits a retry, how long should we wait?