use thiserror::Error;
use crate::InternalSolverError;
#[derive(Debug, Copy, Clone, Error)]
pub enum AddConstraintError {
#[error("The constraint specified has already been added to the solver.")]
DuplicateConstraint,
#[error("The constraint is required, but it is unsatisfiable in conjunction with the existing constraints.")]
UnsatisfiableConstraint,
#[error("The solver entered an invalid state. If this occurs please report the issue.")]
InternalSolverError(#[from] InternalSolverError),
}
#[derive(Debug, Copy, Clone, Error)]
pub enum RemoveConstraintError {
#[error("The constraint specified was not already in the solver, so cannot be removed.")]
UnknownConstraint,
#[error("The solver entered an invalid state. If this occurs please report the issue.")]
InternalSolverError(#[from] InternalSolverError),
}
#[derive(Debug, Copy, Clone, Error)]
pub enum AddEditVariableError {
#[error("The specified variable is already marked as an edit variable in the solver.")]
DuplicateEditVariable,
#[error("The specified strength was `REQUIRED`. This is illegal for edit variable strengths.")]
BadRequiredStrength,
}
#[derive(Debug, Copy, Clone, Error)]
pub enum RemoveEditVariableError {
#[error(
"The specified variable was not an edit variable in the solver, so cannot be removed."
)]
UnknownEditVariable,
#[error("The solver entered an invalid state. If this occurs please report the issue.")]
InternalSolverError(#[from] InternalSolverError),
}
#[derive(Debug, Copy, Clone, Error)]
pub enum SuggestValueError {
#[error(
"The specified variable was not an edit variable in the solver, so cannot have its value suggested."
)]
UnknownEditVariable,
#[error("The solver entered an invalid state. If this occurs please report the issue.")]
InternalSolverError(#[from] InternalSolverError),
}