kizzasi_logic/
error.rs

1//! Error types for kizzasi-logic
2
3use thiserror::Error;
4
5/// Result type alias for logic operations
6pub type LogicResult<T> = Result<T, LogicError>;
7
8/// Errors that can occur in the logic module
9#[derive(Error, Debug)]
10pub enum LogicError {
11    #[error("Invalid constraint: {0}")]
12    InvalidConstraint(String),
13
14    #[error("Constraint violation: {constraint} - value {value} violates {bound}")]
15    ConstraintViolation {
16        constraint: String,
17        value: f32,
18        bound: String,
19    },
20
21    #[error("Projection failed: {0}")]
22    ProjectionFailed(String),
23
24    #[error("Dimension mismatch: expected {expected}, got {got}")]
25    DimensionMismatch { expected: usize, got: usize },
26
27    #[error("Invalid input: {0}")]
28    InvalidInput(String),
29
30    #[error("Infeasible constraint: {0}")]
31    InfeasibleConstraint(String),
32
33    #[error("Core error: {0}")]
34    CoreError(#[from] kizzasi_core::CoreError),
35}