pub enum BrokerError {
Connection(String),
Serialization(String),
QueueNotFound(String),
MessageNotFound(Uuid),
Timeout,
Configuration(String),
OperationFailed(String),
}Expand description
Broker errors
§Examples
use celers_kombu::BrokerError;
let err = BrokerError::Connection("failed to connect".to_string());
assert!(err.is_connection());
assert!(err.is_retryable());
assert_eq!(err.category(), "connection");
let err = BrokerError::Timeout;
assert!(err.is_timeout());
assert!(err.is_retryable());
let err = BrokerError::QueueNotFound("celery".to_string());
assert!(err.is_queue_not_found());
assert!(!err.is_retryable());Variants§
Connection(String)
Serialization(String)
QueueNotFound(String)
MessageNotFound(Uuid)
Timeout
Configuration(String)
OperationFailed(String)
Implementations§
Source§impl BrokerError
impl BrokerError
Sourcepub fn is_connection(&self) -> bool
pub fn is_connection(&self) -> bool
Check if the error is connection-related
Sourcepub fn is_serialization(&self) -> bool
pub fn is_serialization(&self) -> bool
Check if the error is serialization-related
Sourcepub fn is_queue_not_found(&self) -> bool
pub fn is_queue_not_found(&self) -> bool
Check if the error is queue-not-found
Sourcepub fn is_message_not_found(&self) -> bool
pub fn is_message_not_found(&self) -> bool
Check if the error is message-not-found
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Check if the error is a timeout
Sourcepub fn is_configuration(&self) -> bool
pub fn is_configuration(&self) -> bool
Check if the error is configuration-related
Sourcepub fn is_operation_failed(&self) -> bool
pub fn is_operation_failed(&self) -> bool
Check if the error is an operation failure
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this is a retryable error
Returns true for connection, timeout, and operation failures, which are typically transient. Returns false for serialization, configuration, and not-found errors.
Trait Implementations§
Source§impl Debug for BrokerError
impl Debug for BrokerError
Source§impl Display for BrokerError
impl Display for BrokerError
Source§impl Error for BrokerError
impl Error for BrokerError
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 BrokerError
impl RefUnwindSafe for BrokerError
impl Send for BrokerError
impl Sync for BrokerError
impl Unpin for BrokerError
impl UnsafeUnpin for BrokerError
impl UnwindSafe for BrokerError
Blanket Implementations§
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