esp_idf_part/
error.rs

1/// Partition table errors
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4    /// Two or more partitions with the same name were found
5    #[error("Two or more partitions with the same name ('{0}') were found")]
6    DuplicatePartitions(String),
7
8    /// The checksum in the binary data does not match the computed value
9    #[error("The binary's checksum is invalid (expected '{expected:?}', computed '{computed:?}')")]
10    InvalidChecksum {
11        expected: Vec<u8>,
12        computed: Vec<u8>,
13    },
14
15    /// Partition with type 'data' and subtype 'ota' must have size of 0x2000
16    /// (8k) bytes
17    #[error("Partition with type 'data' and subtype 'ota' must have size of 0x2000 (8k) bytes")]
18    InvalidOtadataPartitionSize,
19
20    /// The length of the binary data is not a multiple of 32
21    #[error("The length of the binary data is not a multiple of 32")]
22    LengthNotMultipleOf32,
23
24    /// Multiple partitions with type 'app' and subtype 'factory' were found
25    #[error("Multiple partitions with type 'app' and subtype 'factory' were found")]
26    MultipleFactoryPartitions,
27
28    /// Multiple partitions with type 'data' and subtype 'ota' were found
29    #[error("Multiple partitions with type 'data' and subtype 'ota' were found")]
30    MultipleOtadataPartitions,
31
32    /// No partition of type 'app' was found in the partition table
33    #[error("No partition of type 'app' was found in the partition table")]
34    NoAppPartition,
35
36    /// No ned marker was found in the binary data
37    #[error("No ned marker was found in the binary data")]
38    NoEndMarker,
39
40    /// Two partitions are overlapping each other
41    #[error("Two partitions are overlapping each other: '{0}' and '{1}'")]
42    OverlappingPartitions(String, String),
43
44    /// Partition is above the maximum supported size of 16MB
45    #[error("Partition larger than maximum supported size of 16MB: '{0}'")]
46    PartitionTooLarge(String),
47
48    /// The partition is not correctly aligned
49    #[error("The partition is not correctly aligned")]
50    UnalignedPartition,
51
52    /// An error which originated in the `csv` package
53    #[error(transparent)]
54    CsvError(#[from] csv::Error),
55
56    /// An error which originated in the `deku` package
57    #[error(transparent)]
58    DekuError(#[from] deku::DekuError),
59
60    /// An error which occurred while trying to convert bytes to a String
61    #[error(transparent)]
62    FromUtf8Error(#[from] std::string::FromUtf8Error),
63
64    /// An error which originated in the `std::io` module
65    #[error(transparent)]
66    IoError(#[from] std::io::Error),
67}