1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, BinateError>;
4
5#[derive(Debug, Error)]
6#[non_exhaustive]
7pub enum BinateError {
8 #[error("I/O error: {0}")]
9 Io(#[from] std::io::Error),
10
11 #[error("Binary parse error: {0}")]
12 ObjectParse(#[from] object::read::Error),
13
14 #[error("DWARF error: {0}")]
15 Dwarf(#[from] gimli::Error),
16
17 #[error("Unsupported architecture: {0}")]
18 UnsupportedArch(String),
19
20 #[error("Section not found: {0}")]
21 SectionNotFound(String),
22
23 #[error("JSON serialization error: {0}")]
24 Json(#[from] serde_json::Error),
25}