pub enum SierraError {
Protocol {
code: ErrorCode,
message: Option<String>,
},
Redis(RedisError),
}Expand description
Errors that can occur when using the SierraDB client.
Variants§
Protocol
A protocol-level error returned by the Sierra server
Redis(RedisError)
A Redis client error (connection, parsing, etc.)
Implementations§
Source§impl SierraError
impl SierraError
Sourcepub fn from_redis_error(redis_error: RedisError) -> Self
pub fn from_redis_error(redis_error: RedisError) -> Self
Parse a Redis error response into a SierraError.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error indicates a temporary failure that should be retried.
Sourcepub fn is_cluster_issue(&self) -> bool
pub fn is_cluster_issue(&self) -> bool
Check if this error indicates a cluster availability issue.
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if this error indicates a client argument error.
Sourcepub fn error_code(&self) -> Option<ErrorCode>
pub fn error_code(&self) -> Option<ErrorCode>
Get the error code if this is a protocol error.
Sourcepub fn retry_delay_ms(&self) -> Option<u64>
pub fn retry_delay_ms(&self) -> Option<u64>
Get a suggested retry delay in milliseconds for retryable errors. Returns None if the error should not be retried.
Trait Implementations§
Source§impl Debug for SierraError
impl Debug for SierraError
Source§impl Display for SierraError
impl Display for SierraError
Source§impl Error for SierraError
impl Error for SierraError
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()
Source§impl From<RedisError> for SierraError
impl From<RedisError> for SierraError
Source§fn from(err: RedisError) -> Self
fn from(err: RedisError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SierraError
impl !RefUnwindSafe for SierraError
impl Send for SierraError
impl Sync for SierraError
impl Unpin for SierraError
impl UnsafeUnpin for SierraError
impl !UnwindSafe for SierraError
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