Skip to main content

pgevolve_core/
error.rs

1//! Top-level error types for `pgevolve-core`.
2//!
3//! Per-phase error variants (parse, catalog, diff, plan) are added by their
4//! respective modules. This file declares the umbrella type and re-exports.
5
6use thiserror::Error;
7
8/// Top-level error type. Each variant carries the typed error from one phase.
9#[derive(Debug, Error)]
10pub enum Error {
11    /// IR-construction error (e.g., invalid identifier).
12    #[error(transparent)]
13    Ir(#[from] crate::ir::IrError),
14    /// Source-parser error.
15    #[error(transparent)]
16    Parse(#[from] crate::parse::ParseError),
17    /// Catalog-reader error.
18    #[error(transparent)]
19    Catalog(#[from] crate::catalog::CatalogError),
20    /// Plan-ordering error.
21    #[error(transparent)]
22    Plan(#[from] crate::plan::PlanError),
23    // Diff variant added by later phases.
24}
25
26/// Result alias for crate-level operations.
27pub type Result<T> = std::result::Result<T, Error>;