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()