pub struct ProviderError {
pub operation: String,
pub message: String,
pub retryable: bool,
}Expand description
Provider-specific error with retry classification
Providers return this error type to indicate whether an error should be retried.
The runtime uses is_retryable() to decide whether to retry the operation.
§Error Classification
Retryable (is_retryable = true):
- Database busy/locked
- Connection timeouts
- Network failures
- Temporary resource exhaustion
Non-retryable (is_retryable = false):
- Data corruption (missing instance, invalid format)
- Duplicate events (indicates bug)
- Invalid input (malformed work item)
- Configuration errors
- Invalid lock tokens (idempotent - already processed)
§Example Usage
use duroxide::providers::ProviderError;
// Transient error - retryable
return Err(ProviderError::retryable("ack_orchestration_item", "Database is busy"));
// Permanent error - not retryable
return Err(ProviderError::permanent("ack_orchestration_item", "Duplicate event detected"));Fields§
§operation: StringOperation that failed (e.g., “ack_orchestration_item”, “fetch_orchestration_item”)
message: StringHuman-readable error message
retryable: boolWhether this error should be retried
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn retryable(
operation: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn retryable( operation: impl Into<String>, message: impl Into<String>, ) -> Self
Create a retryable (transient) error
Use for errors that might succeed on retry:
- Database busy/locked
- Connection timeouts
- Network failures
Sourcepub fn permanent(
operation: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn permanent( operation: impl Into<String>, message: impl Into<String>, ) -> Self
Create a non-retryable (permanent) error
Use for errors that won’t succeed on retry:
- Data corruption
- Duplicate events
- Invalid input
- Configuration errors
- Invalid lock tokens (idempotent)
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if error is retryable
Sourcepub fn to_infrastructure_error(&self) -> ErrorDetails
pub fn to_infrastructure_error(&self) -> ErrorDetails
Convert to ErrorDetails::Infrastructure for runtime
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§fn clone(&self) -> ProviderError
fn clone(&self) -> ProviderError
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<&str> for ProviderError
impl From<&str> for ProviderError
Source§impl From<ProviderError> for ClientError
impl From<ProviderError> for ClientError
Source§fn from(e: ProviderError) -> Self
fn from(e: ProviderError) -> Self
Converts to this type from the input type.
Source§impl From<String> for ProviderError
Conversion from String for backward compatibility
impl From<String> for ProviderError
Conversion from String for backward compatibility
Source§impl PartialEq for ProviderError
impl PartialEq for ProviderError
impl Eq for ProviderError
impl StructuralPartialEq for ProviderError
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnwindSafe for ProviderError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)