use thiserror::Error;
#[derive(Debug, Error)]
pub enum BuildError {
#[error("parse error: {0}")]
Parse(#[from] ParseError),
#[error("extraction error: {0}")]
Extraction(#[from] ExtractionError),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
}
#[derive(Debug, Error)]
#[error("parse error at byte {byte_offset}: {message}")]
pub struct ParseError {
pub byte_offset: usize,
pub message: String,
}
#[derive(Debug, Error)]
#[error("extraction error for node kind '{node_kind}': {message}")]
pub struct ExtractionError {
pub node_kind: String,
pub message: String,
}