stalmarck_sat/error.rs
1use thiserror::Error;
2
3/// Custom error type for the StalmarckSAT library
4#[derive(Error, Debug)]
5pub enum Error {
6 /// I/O errors
7 #[error("I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 /// Parsing errors
11 #[error("Parse error: {0}")]
12 Parse(String),
13
14 /// Invalid format errors
15 #[error("Invalid format: {0}")]
16 InvalidFormat(String),
17
18 /// Variable out of bounds
19 #[error("Variable out of bounds: {0}")]
20 VariableOutOfBounds(i32),
21
22 /// Solver errors
23 #[error("Solver error: {0}")]
24 Solver(String),
25
26 /// Timeout occurred
27 #[error("Solver timed out after {0} seconds")]
28 Timeout(f64),
29}