use parol_runtime::ParolError;
use std::path::PathBuf;
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum YangError {
#[error("{}: {source}", path.display())]
IoError {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("YANG module `{name}` not found in the search path")]
FileNotFound { name: String },
#[error("{}: {source}", path.display())]
ParseError {
path: PathBuf,
#[source]
source: Box<ParolError>,
},
#[error("YANG document contains neither a module nor a submodule")]
EmptyDocument,
}