Skip to main content

f00_core/
error.rs

1use std::path::PathBuf;
2
3/// Errors produced while reading the filesystem.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6    #[error("failed to read directory {path}: {source}")]
7    ReadDir {
8        path: PathBuf,
9        source: std::io::Error,
10    },
11    #[error("failed to read metadata for {path}: {source}")]
12    Metadata {
13        path: PathBuf,
14        source: std::io::Error,
15    },
16    #[error("path not found: {0}")]
17    NotFound(PathBuf),
18    #[error(transparent)]
19    Io(#[from] std::io::Error),
20}
21
22pub type Result<T> = std::result::Result<T, Error>;