1use thiserror::Error;
2
3#[derive(Debug, Error, Eq, PartialEq)]
4#[non_exhaustive]
5pub enum NarError {
6 #[error("IO error: {0}")]
7 IoError(String),
8 #[error("Parse error: {0}")]
9 ParseError(String),
10 #[error("API error: {0}")]
11 ApiError(String),
12 #[error("Pack error: {0}")]
13 PackError(String),
14 #[error("Unpack error: {0}")]
15 UnpackError(String),
16 #[error("UTF8 path error: {0}")]
17 Utf8PathError(String),
18}
19
20impl From<std::io::Error> for NarError {
21 fn from(v: std::io::Error) -> Self {
22 Self::IoError(v.to_string())
23 }
24}