pub enum ProcessingError {
Retryable {
message: String,
custom_delay: Option<Duration>,
},
NonRetryable {
message: String,
send_to_dlq: bool,
},
}Expand description
Processing error types for consumer handlers
Variants§
Retryable
Retryable error - message should be retried with delay
NonRetryable
Non-retryable error - message should be rejected permanently
Implementations§
Source§impl ProcessingError
impl ProcessingError
Sourcepub fn retryable<S: Into<String>>(message: S) -> Self
pub fn retryable<S: Into<String>>(message: S) -> Self
Create a retryable error with default delay
Sourcepub fn retryable_with_delay<S: Into<String>>(
message: S,
delay: Duration,
) -> Self
pub fn retryable_with_delay<S: Into<String>>( message: S, delay: Duration, ) -> Self
Create a retryable error with custom delay
Sourcepub fn non_retryable<S: Into<String>>(message: S) -> Self
pub fn non_retryable<S: Into<String>>(message: S) -> Self
Create a non-retryable error (will be sent to DLQ)
Sourcepub fn discard<S: Into<String>>(message: S) -> Self
pub fn discard<S: Into<String>>(message: S) -> Self
Create a non-retryable error that should be discarded (not sent to DLQ)
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
Sourcepub fn should_send_to_dlq(&self) -> bool
pub fn should_send_to_dlq(&self) -> bool
Check if this error should be sent to DLQ
Sourcepub fn custom_delay(&self) -> Option<Duration>
pub fn custom_delay(&self) -> Option<Duration>
Get custom delay if specified
Trait Implementations§
Source§impl Clone for ProcessingError
impl Clone for ProcessingError
Source§fn clone(&self) -> ProcessingError
fn clone(&self) -> ProcessingError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProcessingError
impl Debug for ProcessingError
Source§impl Display for ProcessingError
impl Display for ProcessingError
Source§impl Error for ProcessingError
impl Error for ProcessingError
1.30.0 · Source§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 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ProcessingError
impl RefUnwindSafe for ProcessingError
impl Send for ProcessingError
impl Sync for ProcessingError
impl Unpin for ProcessingError
impl UnwindSafe for ProcessingError
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
Mutably borrows from an owned value. Read more