pgevolve_core/catalog/
error.rs1use thiserror::Error;
4
5use crate::catalog::CatalogQuery;
6use crate::ir::IrError;
7use crate::parse::ParseError;
8
9#[derive(Debug, Error)]
11pub enum CatalogError {
12 #[error("catalog query {query:?} failed: {message}")]
14 QueryFailed {
15 query: CatalogQuery,
17 message: String,
19 },
20
21 #[error("catalog query {query:?} returned no rows")]
23 MissingResult {
24 query: CatalogQuery,
26 },
27
28 #[error("catalog row missing column {column:?} for query {query:?}")]
30 MissingColumn {
31 query: CatalogQuery,
33 column: String,
35 },
36
37 #[error("catalog row column {column:?} had unexpected type for query {query:?}: {message}")]
39 BadColumnType {
40 query: CatalogQuery,
42 column: String,
44 message: String,
46 },
47
48 #[error("unsupported Postgres major version: {0} (supported: 14, 15, 16, 17)")]
50 UnsupportedPgVersion(u32),
51
52 #[error("schema {0:?} is reserved and cannot be managed by pgevolve")]
54 CannotManageReservedSchema(String),
55
56 #[error("invalid ignore glob {0:?}: {1}")]
58 InvalidIgnoreGlob(String, glob::PatternError),
59
60 #[error("IR error while assembling catalog: {0}")]
62 Ir(#[from] IrError),
63
64 #[error("re-parsing introspected SQL fragment failed: {0}")]
66 ReparseFailed(#[from] Box<ParseError>),
67
68 #[error("catalog assembly: dangling reference {kind} for {what}")]
70 DanglingReference {
71 kind: &'static str,
73 what: String,
75 },
76}