-
Notifications
You must be signed in to change notification settings - Fork 324
Open
Description
Answering the question: "was this failure a validation error or something else?" should be trivial for downstream consumers.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ErrorCategory { Fundamental, Validation, ThirdParty }
impl ErrorKind {
pub fn category(&self) -> ErrorCategory { todo!() }
pub fn is_validation(&self) -> bool { matches!(self.category(), ErrorCategory::Validation) }
}
impl Error {
pub fn category(&self) -> ErrorCategory { self.kind().category() }
}Metadata
Metadata
Assignees
Labels
No labels