logicaffeine_compile/extraction/
error.rs1use std::fmt;
4
5#[derive(Debug)]
7pub enum ExtractError {
8 NotFound(String),
10
11 NotExtractable { name: String, reason: String },
13
14 Internal(String),
16}
17
18impl fmt::Display for ExtractError {
19 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
20 match self {
21 ExtractError::NotFound(name) => write!(f, "Not found: {}", name),
22 ExtractError::NotExtractable { name, reason } => {
23 write!(f, "Cannot extract '{}': {}", name, reason)
24 }
25 ExtractError::Internal(msg) => write!(f, "Internal error: {}", msg),
26 }
27 }
28}
29
30impl std::error::Error for ExtractError {}