pub enum Error {
Show 22 variants
NotFound,
Gone,
PermissionDenied,
Unauthorized,
DbError,
Parse,
ValidationError(String),
Conflict(String),
PreconditionRequired(String),
SettingNotFound(String),
NetworkError(String),
Timeout,
ConfigError(String),
ServiceUnavailable(String),
Internal(String),
ImageError(String),
CryptoError(String),
FileSourceNotFound,
FileSourceForbidden,
FileSourceUnreachable,
FileCycleRejected,
Io(Error),
}Variants§
NotFound
Gone
410 - the resource existed but is permanently gone (used for the IDP
activation-resend endpoint when Identity.expires_at has passed —
resending after expiry is impossible because the deadline is fixed at
registration and not extended).
PermissionDenied
DbError
Parse
ValidationError(String)
Conflict(String)
PreconditionRequired(String)
SettingNotFound(String)
404 - settings registry has no entry for the requested key, or the
registered key has no default value and no override is configured.
Used by SettingsService::*_opt to distinguish “not configured” from
“configured with the wrong type”.
NetworkError(String)
Timeout
ConfigError(String)
Internal(String)
ImageError(String)
CryptoError(String)
FileSourceNotFound
FileSourceForbidden
FileSourceUnreachable
FileCycleRejected
Io(Error)
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether a failed operation is worth retrying. A short denylist of
permanent failures returns false; everything else returns true.
Scoped to what the task scheduler’s federation tasks actually return.
Permanent here means “a later attempt cannot succeed”: the sender isn’t
following us, the JWT signature is invalid, the action is malformed, or
the remote resource is gone (410). Transient failures — network/TLS
errors, timeouts, a locked DB, a peer briefly returning 404 — are NOT
listed and so remain retryable. Mis-classifying a rare error toward
“retryable” is cheap (a few wasted attempts, then the retry limit stops
it); mis-classifying toward “permanent” would silently drop recoverable
federated actions, so we err toward retryable.
Known cost of this choice: Error::NotFound is retryable so a peer
briefly 404-ing can recover, but a task whose local target is genuinely
gone (e.g. a deleted action) also returns NotFound and will retry to the
policy limit before on_failed fires. Error carries no local-vs-remote
distinction, so we accept those wasted retries rather than break federation
recovery by denylisting NotFound.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
use the Display impl or to_string()
Source§impl From<ImageError> for Error
Available on crate feature server only.
impl From<ImageError> for Error
server only.Source§fn from(err: ImageError) -> Error
fn from(err: ImageError) -> Error
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(err: ParseIntError) -> Error
fn from(err: ParseIntError) -> Error
Source§impl From<SystemTimeError> for Error
impl From<SystemTimeError> for Error
Source§fn from(err: SystemTimeError) -> Error
fn from(err: SystemTimeError) -> Error
Source§impl From<ToStrError> for Error
impl From<ToStrError> for Error
Source§fn from(err: ToStrError) -> Error
fn from(err: ToStrError) -> Error
Source§impl IntoResponse for Error
impl IntoResponse for Error
Source§fn into_response(self) -> Response<Body>
fn into_response(self) -> Response<Body>
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more