pub enum CcAuditError {
Show 14 variants
Io {
path: PathBuf,
operation: IoOperation,
source: Error,
},
Parse {
path: PathBuf,
format: ParseFormat,
source: Box<dyn Error + Send + Sync>,
},
FileNotFound(PathBuf),
NotADirectory(PathBuf),
NotAFile(PathBuf),
InvalidFormat {
path: PathBuf,
message: String,
},
Regex(Error),
Hook(HookError),
MalwareDb(MalwareDbError),
Watch(Error),
Config(String),
YamlParse {
path: String,
source: Error,
},
InvalidSkillFormat(String),
Json(Error),
}Expand description
Unified error type for all cc-audit operations.
Variants§
Io
I/O operation failed.
Parse
Parse error with preserved source.
FileNotFound(PathBuf)
File not found.
NotADirectory(PathBuf)
Path is not a directory.
NotAFile(PathBuf)
Path is not a file.
InvalidFormat
Invalid format with message.
Regex(Error)
Regex compilation error.
Hook(HookError)
Hook operation failed.
MalwareDb(MalwareDbError)
Malware database error.
Watch(Error)
File watch error.
Config(String)
Configuration error.
YamlParse
YAML parse error (legacy compatibility).
InvalidSkillFormat(String)
Invalid skill format (legacy compatibility).
Json(Error)
JSON error.
Implementations§
Source§impl CcAuditError
impl CcAuditError
Sourcepub fn read_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn read_error(path: impl Into<PathBuf>, source: Error) -> Self
Create an I/O read error.
Sourcepub fn write_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn write_error(path: impl Into<PathBuf>, source: Error) -> Self
Create an I/O write error.
Sourcepub fn json_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn json_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a parse error with JSON format.
Sourcepub fn yaml_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn yaml_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a parse error with YAML format.
Sourcepub fn toml_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
pub fn toml_parse_error(path: impl Into<PathBuf>, source: Error) -> Self
Create a parse error with TOML format.
Sourcepub fn root_cause(&self) -> &dyn Error
pub fn root_cause(&self) -> &dyn Error
Get the root cause of the error chain.
Trait Implementations§
Source§impl Debug for CcAuditError
impl Debug for CcAuditError
Source§impl Display for CcAuditError
impl Display for CcAuditError
Source§impl Error for CcAuditError
impl Error for CcAuditError
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<CcAuditError> for AuditError
Convert from CcAuditError to AuditError for backwards compatibility.
impl From<CcAuditError> for AuditError
Convert from CcAuditError to AuditError for backwards compatibility.
Source§fn from(err: CcAuditError) -> Self
fn from(err: CcAuditError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CcAuditError
impl From<Error> for CcAuditError
Source§impl From<Error> for CcAuditError
impl From<Error> for CcAuditError
Source§impl From<Error> for CcAuditError
impl From<Error> for CcAuditError
Source§impl From<HookError> for CcAuditError
impl From<HookError> for CcAuditError
Source§impl From<MalwareDbError> for CcAuditError
impl From<MalwareDbError> for CcAuditError
Source§fn from(source: MalwareDbError) -> Self
fn from(source: MalwareDbError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CcAuditError
impl !RefUnwindSafe for CcAuditError
impl Send for CcAuditError
impl Sync for CcAuditError
impl Unpin for CcAuditError
impl !UnwindSafe for CcAuditError
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