#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("duplicate proto staged at {path:?}")]
DuplicatePath {
path: String,
},
#[error("protox compile: {0}")]
Protox(#[from] Box<protox::Error>),
#[error("descriptor pool: {0}")]
DescriptorPool(#[from] prost_reflect::DescriptorError),
#[cfg(feature = "tonic")]
#[error("tonic-build codegen: {0}")]
Tonic(#[source] Box<dyn std::error::Error + Send + Sync>),
}
impl From<protox::Error> for Error {
fn from(e: protox::Error) -> Self {
Error::Protox(Box::new(e))
}
}