garbage/src/errors.rs

22 lines
578 B
Rust
Raw Normal View History

2019-11-30 05:02:19 +00:00
#[derive(Debug, Error)]
2019-06-26 07:46:46 +00:00
pub enum Error {
2019-11-30 05:02:19 +00:00
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Walkdir error: {0}")]
WalkDir(#[from] walkdir::Error),
#[error("Bad .trashinfo file: {0}")]
BadTrashInfo(#[from] TrashInfoError),
#[error("Date parsing error: {0}")]
ParseDate(#[from] chrono::format::ParseError),
2019-06-26 07:46:46 +00:00
}
2019-11-30 05:02:19 +00:00
#[derive(Debug, Error)]
2019-06-26 07:46:46 +00:00
pub enum TrashInfoError {
2019-11-30 05:02:19 +00:00
#[error("Missing [TrashInfo] header")]
2019-06-26 07:46:46 +00:00
MissingHeader,
2019-11-30 05:02:19 +00:00
#[error("Missing path attribute")]
2019-06-26 07:46:46 +00:00
MissingPath,
2019-11-30 05:02:19 +00:00
#[error("Missing date attribute")]
2019-06-26 07:46:46 +00:00
MissingDate,
}