hyperi_rustlib/deployment/
error.rs1use thiserror::Error;
12
13#[derive(Debug, Clone)]
15pub struct ContractMismatch {
16 pub field: String,
18 pub expected: String,
20 pub actual: String,
22}
23
24impl std::fmt::Display for ContractMismatch {
25 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26 write!(
27 f,
28 "{}: expected '{}', got '{}'",
29 self.field, self.expected, self.actual
30 )
31 }
32}
33
34#[derive(Debug, Error)]
36pub enum DeploymentError {
37 #[error("failed to read {path}: {source}")]
39 ReadFile {
40 path: String,
41 #[source]
42 source: std::io::Error,
43 },
44
45 #[error("failed to write {path}: {source}")]
47 WriteFile {
48 path: String,
49 #[source]
50 source: std::io::Error,
51 },
52
53 #[error("failed to create directory {path}: {source}")]
55 CreateDir {
56 path: String,
57 #[source]
58 source: std::io::Error,
59 },
60
61 #[error("failed to parse YAML in {path}: {source}")]
63 ParseYaml {
64 path: String,
65 #[source]
66 source: serde_yaml_ng::Error,
67 },
68
69 #[error("file not found: {0}")]
71 NotFound(String),
72}