dpp_domain/catalog/
error.rs1#[derive(Debug, Clone, PartialEq, Eq)]
5#[non_exhaustive]
6pub enum CatalogError {
7 AlreadyExists(String),
9 InvalidSchemaVersion { key: String, version: String },
11 CurrentVersionNotListed { key: String, version: String },
13}
14
15impl std::fmt::Display for CatalogError {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 match self {
18 Self::AlreadyExists(key) => write!(f, "sector '{key}' already in catalog"),
19 Self::InvalidSchemaVersion { key, version } => write!(
20 f,
21 "sector '{key}' currentSchemaVersion '{version}' is not valid semver"
22 ),
23 Self::CurrentVersionNotListed { key, version } => write!(
24 f,
25 "sector '{key}' currentSchemaVersion '{version}' is not in its schemaVersions list"
26 ),
27 }
28 }
29}
30
31impl std::error::Error for CatalogError {}