rust_rule_miner/
errors.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, MiningError>;
4
5#[derive(Error, Debug)]
6pub enum MiningError {
7    #[error("Invalid configuration: {0}")]
8    InvalidConfig(String),
9
10    #[error("Insufficient data: {0}")]
11    InsufficientData(String),
12
13    #[error("IO error: {0}")]
14    Io(#[from] std::io::Error),
15
16    #[error("JSON error: {0}")]
17    Json(#[from] serde_json::Error),
18
19    #[error("Invalid transaction: {0}")]
20    InvalidTransaction(String),
21
22    #[error("Mining failed: {0}")]
23    MiningFailed(String),
24
25    #[error("Export failed: {0}")]
26    ExportFailed(String),
27
28    #[error("Data load error: {0}")]
29    DataLoadError(String),
30}