Skip to main content

harmos_packaging/
error.rs

1/* ***
2 *
3 * Harmos
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * ***
8 */
9
10/* === Modules === */
11
12/* === Re-Exports === */
13
14/* === Imports === */
15
16// Standard Library Imports
17
18// Third Party Imports
19
20// Local Imports
21use crate::bundle;
22
23/* === Constants === */
24
25/* === Macros === */
26
27/* === Type Aliases === */
28
29/* === Structs === */
30
31/* === Enums === */
32
33#[derive(Debug, thiserror::Error)]
34pub enum Error {
35    #[error("build cancelled after retaining and settling its child processes")]
36    Cancelled,
37
38    #[error(transparent)]
39    Watch(#[from] notify::Error),
40
41    #[error(transparent)]
42    Bundle(#[from] bundle::Error),
43
44    #[error(transparent)]
45    Io(#[from] std::io::Error),
46
47    #[error(transparent)]
48    Json(#[from] serde_json::Error),
49
50    #[error(transparent)]
51    Declaration(#[from] harmos_domain::inventory::DeclarationError),
52
53    #[error("invalid packaging settings: {0}")]
54    Settings(String),
55
56    #[error("Cargo build failed: {0}")]
57    Cargo(String),
58
59    #[error("guest componentization failed: {0}")]
60    Component(String),
61
62    #[error("built artifact changed after stamping: {0}")]
63    ArtifactChanged(std::path::PathBuf),
64
65    #[error("generated artifact collision: {0}")]
66    Collision(String),
67}
68
69/* === Traits === */
70
71/* === Implementations === */
72
73/* === Public Functions === */
74
75/* === Private Functions === */
76
77/* === Tests === */