use thiserror::Error;
use super::state::DecompileStage;
use crate::ast::AstLowerError;
use crate::generate::GenerateError;
use crate::naming::NamingError;
use crate::parser::ParseError;
use crate::transformer::TransformError;
#[derive(Debug, Error)]
pub enum DecompileError {
#[error(transparent)]
Parse(#[from] ParseError),
#[error(transparent)]
Transform(#[from] TransformError),
#[error(transparent)]
Ast(#[from] AstLowerError),
#[error(transparent)]
Naming(#[from] NamingError),
#[error(transparent)]
Generate(#[from] GenerateError),
#[error(
"stage `{stage}` is not implemented yet; pipeline currently stops after `{completed_stage}`"
)]
StageNotImplemented {
stage: DecompileStage,
completed_stage: DecompileStage,
},
#[error("this build was compiled without debug dump support")]
DebugUnavailable,
#[error("requested debug output for stage `{stage}`, but that stage has no artifact yet")]
MissingStageOutput { stage: DecompileStage },
}