#[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?
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<AcquireError> for Error
impl From<AcquireError> for Error
Source§fn from(source: AcquireError) -> Self
fn from(source: AcquireError) -> Self
Source§impl From<Error> for ConfigError
impl From<Error> for ConfigError
Source§impl From<InvalidHeaderValue> for Error
impl From<InvalidHeaderValue> for Error
Source§fn from(source: InvalidHeaderValue) -> Self
fn from(source: InvalidHeaderValue) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.