1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use thiserror::Error;
pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Debug, Error)]
pub enum Error {
#[error("Payload exceeds section size. {} > {}.", payload, section)]
SectionSizeExceeded { payload: usize, section: usize },
#[error("Section not found")]
SectionNotFound(String),
#[error("Payload decoding error")]
PayloadDecoding(#[from] Box<bincode::ErrorKind>),
#[error("Binary decoding error")]
BinaryDecoding(#[from] goblin::error::Error),
#[error("File Handling Error")]
File(#[from] std::io::Error),
#[error("Unknown Error")]
Other,
}