Skip to main content

cipherstash_config/
errors.rs

1use super::{list::DuplicateEntry, ColumnConfig};
2use crate::TableConfig;
3use std::convert::Infallible;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
7pub enum ConfigError {
8    #[error("Further qualification to {0} is not possible with qualifer {1}")]
9    UnexpectedQualifier(String, String),
10    #[error("'{0}' is not a valid path")]
11    InvalidPath(String),
12    #[error("Scope qualifiers do no match")]
13    MismatchedScope,
14    #[error(transparent)]
15    Infallible(#[from] Infallible),
16    #[error(transparent)]
17    DuplicateRelation(#[from] DuplicateEntry<TableConfig>),
18    #[error(transparent)]
19    DuplicateField(#[from] DuplicateEntry<ColumnConfig>),
20    #[error("ste_vec index on {table}.{column} requires plaintext_type: json (found {found_plaintext_type})")]
21    SteVecRequiresJson {
22        table: String,
23        column: String,
24        found_plaintext_type: String,
25    },
26    #[error("unsupported config version: {version} (expected {expected})")]
27    UnsupportedVersion { version: u32, expected: u32 },
28    #[error("match index on {table}.{column} requires plaintext_type: text (found {found_plaintext_type})")]
29    MatchRequiresText {
30        table: String,
31        column: String,
32        found_plaintext_type: String,
33    },
34    #[error("Failed to parse encryption config: {0}")]
35    ParseError(String),
36}