#[non_exhaustive]pub enum TaskStoreError {
Encode(String),
Decode(String),
Backend(String),
InvalidTransition(String),
RetentionLimitExceeded {
kind: TaskRetentionLimitKind,
limit: usize,
},
}Expand description
Errors returned by TaskStore implementations.
Encode and decode errors come from (de)serializing task state, and
Backend is the catch-all for the storage layer. Those
three mirror
SessionStoreError and exist
for external implementations; MemoryTaskStore never returns them.
InvalidTransition is different in kind. It
reports that the requested change is not legal for the task’s current
state, which is deterministic and says nothing about storage health, so a
caller must not treat it as retryable. MemoryTaskStore does return it
(#1246).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Encode(String)
Failed to encode task state (e.g. serde serialization error).
Decode(String)
Failed to decode task state (e.g. corrupt data in the backend).
Backend(String)
Backend error (e.g. connection failure, transient storage error).
InvalidTransition(String)
The requested change is not valid for the task’s current state.
Deterministic: the same call fails the same way, so retrying cannot help and callers should not confuse it with an infrastructure failure. Reusing an input request key is the current instance (#1246).
RetentionLimitExceeded
A configured task-retention limit rejected a mutation.
The error carries only the limit category and numeric bound. It never includes the rejected arguments, input, result, or error payload, so it is safe to map, log, or expose through a host’s error policy.
Fields
kind: TaskRetentionLimitKindLimit that rejected the operation.
Trait Implementations§
Source§impl Debug for TaskStoreError
impl Debug for TaskStoreError
Source§impl Display for TaskStoreError
impl Display for TaskStoreError
Source§impl Error for TaskStoreError
impl Error for TaskStoreError
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()