pub enum ErrorClass {
Client {
error_type: String,
retryable: bool,
},
Server {
error_type: String,
retryable: bool,
},
Network {
error_type: String,
timeout: bool,
},
Auth {
error_type: String,
},
Business {
error_type: String,
domain: String,
},
}
Expand description
Error classification for better observability
Variants§
Client
Client errors (4xx equivalent)
Server
Server errors (5xx equivalent)
Network
Network/communication errors
Auth
Authentication/authorization errors
Business
Business logic errors
Implementations§
Source§impl ErrorClass
impl ErrorClass
Sourcepub fn from_error<E: ErrorClassification>(error: &E) -> Self
pub fn from_error<E: ErrorClassification>(error: &E) -> Self
Classify an error using the ErrorClassification
trait
Trait Implementations§
Source§impl Clone for ErrorClass
impl Clone for ErrorClass
Source§fn clone(&self) -> ErrorClass
fn clone(&self) -> ErrorClass
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 moreAuto Trait Implementations§
impl Freeze for ErrorClass
impl RefUnwindSafe for ErrorClass
impl Send for ErrorClass
impl Sync for ErrorClass
impl Unpin for ErrorClass
impl UnwindSafe for ErrorClass
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