use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("lwext4 error: {0}")]
Lwext4(i32),
#[error("Invalid configuration: {0}")]
InvalidConfig(String),
#[error("Block device too small: minimum {min} bytes, got {actual} bytes")]
DeviceTooSmall { min: u64, actual: u64 },
}
impl Error {
pub fn from_lwext4(code: i32) -> Self {
Error::Lwext4(code)
}
}