1use thiserror::Error;
2
3use crate::InternalSolverError;
4
5#[derive(Debug, Copy, Clone, Error)]
7pub enum AddConstraintError {
8 #[error("The constraint specified has already been added to the solver.")]
10 DuplicateConstraint,
11
12 #[error("The constraint is required, but it is unsatisfiable in conjunction with the existing constraints.")]
15 UnsatisfiableConstraint,
16
17 #[error("The solver entered an invalid state. If this occurs please report the issue.")]
19 InternalSolverError(#[from] InternalSolverError),
20}
21
22#[derive(Debug, Copy, Clone, Error)]
24pub enum RemoveConstraintError {
25 #[error("The constraint specified was not already in the solver, so cannot be removed.")]
27 UnknownConstraint,
28
29 #[error("The solver entered an invalid state. If this occurs please report the issue.")]
32 InternalSolverError(#[from] InternalSolverError),
33}
34
35#[derive(Debug, Copy, Clone, Error)]
37pub enum AddEditVariableError {
38 #[error("The specified variable is already marked as an edit variable in the solver.")]
40 DuplicateEditVariable,
41
42 #[error("The specified strength was `REQUIRED`. This is illegal for edit variable strengths.")]
44 BadRequiredStrength,
45}
46
47#[derive(Debug, Copy, Clone, Error)]
49pub enum RemoveEditVariableError {
50 #[error(
52 "The specified variable was not an edit variable in the solver, so cannot be removed."
53 )]
54 UnknownEditVariable,
55
56 #[error("The solver entered an invalid state. If this occurs please report the issue.")]
59 InternalSolverError(#[from] InternalSolverError),
60}
61
62#[derive(Debug, Copy, Clone, Error)]
64pub enum SuggestValueError {
65 #[error(
68 "The specified variable was not an edit variable in the solver, so cannot have its value suggested."
69 )]
70 UnknownEditVariable,
71
72 #[error("The solver entered an invalid state. If this occurs please report the issue.")]
75 InternalSolverError(#[from] InternalSolverError),
76}