solverforge_core/
error.rs

1//! Error types for SolverForge
2
3use thiserror::Error;
4
5/// Main error type for SolverForge operations
6#[derive(Debug, Error)]
7pub enum SolverForgeError {
8    /// Error in solver configuration
9    #[error("Configuration error: {0}")]
10    Config(String),
11
12    /// Error in domain model definition
13    #[error("Domain model error: {0}")]
14    DomainModel(String),
15
16    /// Error during score calculation
17    #[error("Score calculation error: {0}")]
18    ScoreCalculation(String),
19
20    /// Solver was cancelled before completion
21    #[error("Solver was cancelled")]
22    Cancelled,
23
24    /// Invalid operation for current solver state
25    #[error("Invalid state: {0}")]
26    InvalidState(String),
27
28    /// Internal error (should not occur in normal operation)
29    #[error("Internal error: {0}")]
30    Internal(String),
31}
32
33/// Result type alias for SolverForge operations
34pub type Result<T> = std::result::Result<T, SolverForgeError>;