#[non_exhaustive]
pub enum Error {
Show 33 variants
HttpError(Arc<Error>),
InvalidHeaderValue,
InvalidJson(Arc<Error>),
LockFailure,
InvalidTitle(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, Global>,
},
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
HttpError(Arc<Error>)
A HTTP error like a 4XX or 5XX status code
InvalidHeaderValue
Invalid header value, likely if the provided OAuth2 token or User-agent are invalid
InvalidJson(Arc<Error>)
Error when decoding the JSON response from the API
LockFailure
Error if unable to get request concurrency lock
InvalidTitle(Error)
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)
UnknownSaveFailure(Value)
Some save failure happened, but we don’t know what it is
Maxlag(String)
Readonly(String)
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
sourceimpl 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 should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Whether the request should be retried, after some suitable backoff and likely with some retry limit
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()