1pub type Result<T> = std::result::Result<T, Error>;
29
30#[derive(Debug, thiserror::Error)]
35pub enum Error {
36 #[error(transparent)]
37 OperationPolicy(#[from] crate::operations::PolicyError),
38
39 #[error("operation `{id}` appears more than once in the catalog")]
40 DuplicateOperation { id: String },
41
42 #[error("operation `{id}` uses the reserved facility namespace")]
43 ReservedOperation { id: String },
44
45 #[error(transparent)]
46 Config(#[from] crate::ConfigError),
47
48 #[error(transparent)]
49 Identifier(#[from] crate::IdentifierError),
50
51 #[error(transparent)]
52 Message(#[from] crate::MessageError),
53
54 #[error(transparent)]
55 Registration(#[from] crate::RegistrationError),
56
57 #[error(transparent)]
58 Scan(#[from] crate::ScanError),
59
60 #[error(transparent)]
61 Value(#[from] crate::ValueError),
62
63 #[error("invalid {field}: {reason}")]
64 InvalidInput { field: &'static str, reason: &'static str },
65
66 #[error("{resource} capacity is exhausted")]
67 ResourceExhausted { resource: &'static str },
68
69 #[error("positions belong to different store histories")]
70 DifferentHistory,
71
72 #[error("{operation} found a corrupt stored value: {source}")]
73 Corrupt {
74 operation: &'static str,
75
76 #[source]
77 source: crate::MessageError,
78 },
79}
80
81