use std::path::PathBuf;
#[derive(thiserror::Error, Clone, Debug)]
#[non_exhaustive]
pub enum Error {
#[error("File not found {0}")]
FileNotFound(String),
#[error("Error opening file {}: {1}", .0.display())]
FileOpen(PathBuf, String),
#[error("Error fetching file {0}: {1}")]
RemoteFetch(String, String),
#[error("Could not read file {0}")]
LoadError(String),
#[error("Can not fetch directory bytes {}", .0.display())]
IsDirectory(PathBuf),
#[error("Could not parse location format: {0}")]
Parse(String),
}
impl From<std::io::Error> for Error {
fn from(e: std::io::Error) -> Self {
Self::LoadError(e.to_string())
}
}