mint_cli/layout/
errors.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum LayoutError {
5    #[error("File error: {0}.")]
6    FileError(String),
7
8    #[error("Block not found: {0}.")]
9    BlockNotFound(String),
10
11    #[error("Data value export failed: {0}.")]
12    DataValueExportFailed(String),
13
14    #[error("Invalid block argument: {0}.")]
15    InvalidBlockArgument(String),
16
17    #[error("No blocks provided.")]
18    NoBlocksProvided,
19
20    #[error("Missing datasheet: {0}")]
21    MissingDataSheet(String),
22
23    #[error("In field '{field}': {source}")]
24    InField {
25        field: String,
26        #[source]
27        source: Box<LayoutError>,
28    },
29
30    #[error(
31        "bitfield value {value} out of range for {bits}-bit {signedness} field ({min}..={max})"
32    )]
33    BitfieldOutOfRange {
34        value: i128,
35        bits: usize,
36        signedness: &'static str,
37        min: i128,
38        max: i128,
39    },
40
41    #[error(transparent)]
42    Variant(#[from] crate::variant::errors::VariantError),
43}