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