use thiserror::Error;

#[derive(Debug, Error)]
pub enum ReflectionError {
    #[error("duplicate step id: '{0}'")]
    DuplicateStepId(String),

    #[error("invalid depends_on references: {}", .0.join(", "))]
    BadDependencyRefs(Vec<String>),

    #[error("cycle detected in step dependency graph")]
    CycleDetected,

    #[error("unknown parameter placeholders in cmd (not in RunContext.params): {}", .0.join(", "))]
    UnknownParams(Vec<String>),

    #[error("nickel export failed on '{path}': {stderr}")]
    NickelExport { path: String, stderr: String },

    #[error("failed to parse ReflectionMode from nickel output: {0}")]
    ParseMode(#[from] serde_json::Error),

    #[error("step task panicked: {0}")]
    TaskPanic(String),
}
