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