pub enum BosonError {
TaskNotFound(String),
JobNotFound(String),
RunNotFound(String),
TaskConfigNotFound(String),
ParamError(String),
SignatureMismatch {
expected: String,
actual: String,
},
InvalidConfig(String),
Backend {
message: String,
source: Option<Box<dyn StdError + Send + Sync>>,
},
Internal {
message: String,
source: Option<Box<dyn StdError + Send + Sync>>,
},
RateLimited(String),
UnknownBackend(String),
}Expand description
Errors that can occur in Boson operations.
Variants§
TaskNotFound(String)
Task not found in registry.
JobNotFound(String)
Job not found.
RunNotFound(String)
Run not found.
TaskConfigNotFound(String)
Task config not found.
ParamError(String)
Parameter serialization/deserialization error.
SignatureMismatch
Signature mismatch between job and current task.
Fields
InvalidConfig(String)
Invalid priority or pool.
Backend
Persistence / adapter backend failure.
Fields
Internal
Internal error.
Fields
RateLimited(String)
Enqueue blocked by rate limit or in-flight cap; caller should retry after backoff.
UnknownBackend(String)
Named queue backend not registered on the router.
Implementations§
Source§impl BosonError
impl BosonError
Sourcepub fn backend(message: impl Into<String>) -> Self
pub fn backend(message: impl Into<String>) -> Self
Backend failure without an underlying source.
Sourcepub fn backend_source(
message: impl Into<String>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn backend_source( message: impl Into<String>, source: impl StdError + Send + Sync + 'static, ) -> Self
Backend failure wrapping an underlying error.
Sourcepub fn internal(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
Internal failure without an underlying source.
Sourcepub fn internal_source(
message: impl Into<String>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn internal_source( message: impl Into<String>, source: impl StdError + Send + Sync + 'static, ) -> Self
Internal failure wrapping an underlying error.
Sourcepub fn backend_message(&self) -> Option<&str>
pub fn backend_message(&self) -> Option<&str>
Message text for Self::Backend, if this is a backend error.
Sourcepub fn is_backend_unique_violation(&self) -> bool
pub fn is_backend_unique_violation(&self) -> bool
True when a backend adapter reported a unique / duplicate-key constraint failure.
Trait Implementations§
Source§impl Debug for BosonError
impl Debug for BosonError
Source§impl Display for BosonError
impl Display for BosonError
Source§impl Error for BosonError
impl Error for BosonError
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()