1use thiserror::Error;
4
5#[derive(Debug, Error)]
7pub enum SimulationError {
8 #[error("Invalid configuration: {0}")]
10 InvalidConfiguration(String),
11
12 #[error("Population cannot be empty")]
14 EmptyPopulation,
15
16 #[error("At least one statute is required")]
18 NoStatutes,
19
20 #[error("Simulation was cancelled")]
22 Cancelled,
23
24 #[error("I/O error: {0}")]
26 Io(#[from] std::io::Error),
27
28 #[error("Serialization error: {0}")]
30 Serialization(#[from] serde_json::Error),
31
32 #[error("Invalid date range: start must be before end")]
34 InvalidDateRange,
35
36 #[error("Temporal configuration error: {0}")]
38 TemporalConfig(String),
39
40 #[error("Population generation error: {0}")]
42 PopulationGeneration(String),
43
44 #[error("Checkpoint error: {0}")]
46 Checkpoint(String),
47
48 #[error("Configuration error: {0}")]
50 ConfigurationError(String),
51
52 #[error("Execution error: {0}")]
54 ExecutionError(String),
55
56 #[error("Invalid population: {0}")]
58 InvalidPopulation(String),
59
60 #[error("Invalid parameter: {0}")]
62 InvalidParameter(String),
63}
64
65pub type SimResult<T> = Result<T, SimulationError>;