1use crate::UpdateFaultPoint;
2
3#[derive(Debug, thiserror::Error)]
5pub enum UpdateError {
6 #[error("invalid artifact metadata: {0}")]
8 InvalidArtifact(String),
9 #[error("incompatible artifact: {0}")]
11 Incompatible(String),
12 #[error("update provider failed: {0}")]
14 Provider(String),
15 #[error("artifact exceeds maximum size of {max_bytes} bytes")]
17 ArtifactTooLarge {
18 max_bytes: usize,
20 },
21 #[error("artifact checksum mismatch")]
23 ChecksumMismatch,
24 #[error("artifact authenticity verification failed: {0}")]
26 Authenticity(String),
27 #[error("artifact store failed: {0}")]
29 Store(String),
30 #[error("activated artifact failed health verification: {0}")]
32 Health(String),
33 #[error("injected update fault at {0:?}")]
35 InjectedFault(UpdateFaultPoint),
36 #[error("rollback failed after {cause}: {rollback}")]
38 RollbackFailed {
39 cause: String,
41 rollback: String,
43 },
44}
45
46pub type UpdateResult<T> = Result<T, UpdateError>;