Skip to main content

oxinav_core/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum OxiNavError {
6    #[error("I/O error at {path}: {source}")]
7    Io {
8        path: PathBuf,
9        #[source]
10        source: std::io::Error,
11    },
12    #[error("destination already exists: {0}")]
13    DestinationExists(PathBuf),
14    #[error("source not found: {0}")]
15    SourceNotFound(PathBuf),
16    #[error("not a directory: {0}")]
17    NotADirectory(PathBuf),
18    #[error("unsupported archive format: {0}")]
19    UnsupportedArchive(PathBuf),
20    #[error("archive entry escapes the destination directory: {0}")]
21    UnsafeArchiveEntry(String),
22}