canic_backup/manifest/
error.rs1use thiserror::Error as ThisError;
2
3#[derive(Debug, ThisError)]
8pub enum ManifestValidationError {
9 #[error("unsupported manifest version {0}")]
10 UnsupportedManifestVersion(u16),
11
12 #[error("field {0} must not be empty")]
13 EmptyField(&'static str),
14
15 #[error("collection {0} must not be empty")]
16 EmptyCollection(&'static str),
17
18 #[error("field {field} must be a valid principal: {value}")]
19 InvalidPrincipal { field: &'static str, value: String },
20
21 #[error("field {0} must be a non-empty sha256 hex string")]
22 InvalidHash(&'static str),
23
24 #[error("unsupported hash algorithm {0}")]
25 UnsupportedHashAlgorithm(String),
26
27 #[error("unsupported verification kind {0}")]
28 UnsupportedVerificationKind(String),
29
30 #[error("topology hash mismatch between discovery {discovery} and pre-snapshot {pre_snapshot}")]
31 TopologyHashMismatch {
32 discovery: String,
33 pre_snapshot: String,
34 },
35
36 #[error("accepted topology hash {accepted} does not match discovery hash {discovery}")]
37 AcceptedTopologyHashMismatch { accepted: String, discovery: String },
38
39 #[error("duplicate canister id {0}")]
40 DuplicateCanisterId(String),
41
42 #[error("duplicate backup unit id {0}")]
43 DuplicateBackupUnitId(String),
44
45 #[error("backup unit {unit_id} repeats role {role}")]
46 DuplicateBackupUnitRole { unit_id: String, role: String },
47
48 #[error("fleet member {0} has no concrete verification checks")]
49 MissingMemberVerificationChecks(String),
50
51 #[error("backup unit {unit_id} references unknown role {role}")]
52 UnknownBackupUnitRole { unit_id: String, role: String },
53
54 #[error("fleet role {role} is not covered by any backup unit")]
55 BackupUnitCoverageMissingRole { role: String },
56
57 #[error("verification plan references unknown role {role}")]
58 UnknownVerificationRole { role: String },
59
60 #[error("duplicate member verification role {0}")]
61 DuplicateMemberVerificationRole(String),
62
63 #[error("verification check {kind} repeats role {role}")]
64 DuplicateVerificationCheckRole { kind: String, role: String },
65
66 #[error("subtree backup unit {unit_id} is not connected")]
67 SubtreeBackupUnitNotConnected { unit_id: String },
68
69 #[error(
70 "subtree backup unit {unit_id} includes parent {parent} but omits descendant {descendant}"
71 )]
72 SubtreeBackupUnitMissingDescendant {
73 unit_id: String,
74 parent: String,
75 descendant: String,
76 },
77}