use thiserror::Error;
#[derive(Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum XfsError {
#[error("buffer too small for {structure}: need {need} bytes, have {have}")]
Truncated {
structure: &'static str,
need: usize,
have: usize,
},
#[error("bad superblock magic: found {found:#010x} (bytes {bytes:02x?}), expected 0x58465342 (\"XFSB\")")]
BadMagic {
found: u32,
bytes: [u8; 4],
},
#[error("unsupported directory: {detail}")]
UnsupportedDir {
detail: String,
},
#[error("path not found: component {component:?} of {path:?} did not resolve")]
PathNotFound {
path: String,
component: String,
},
}