1use thiserror::Error;
19
20#[derive(Error, Debug, PartialEq)]
24pub enum ShapeError {
25 #[error("Parse error: {0}")]
26 ParseError(String),
27 #[error("Non-finite numeric value detected (NaN/Inf)")]
28 InvalidNumericValue,
29 #[error("Scope capacity overflow")]
30 CapacityOverflow,
31 #[error("Split sizes are empty")]
32 EmptySplit,
33 #[error("Split floating size must be positive: {0}")]
34 InvalidFloatingSize(f64),
35 #[error("Split absolute sizes exceed scope dimension {0}")]
36 SplitOverflow(f64),
37 #[error("No floating slots to absorb remainder in split")]
38 NoFloatingSlots,
39 #[error("Comp selector '{0}' not recognised")]
40 UnknownCompSelector(String),
41 #[error("Derivation depth limit {0} exceeded")]
42 DepthLimitExceeded(usize),
43 #[error("Internal error: {0}")]
44 Internal(String),
45 #[error("Offset inset distance exceeds scope dimension")]
46 OffsetTooLarge,
47 #[error("Roof angle must be in (0°, 90°): got {0}")]
48 InvalidRoofAngle(f64),
49 #[error("Align target vector must be non-zero")]
50 InvalidAlignTarget,
51 #[error("Unknown identifier '{0}' (not a parameter, attribute, or constant)")]
52 UnknownIdentifier(String),
53 #[error("Rule call arity mismatch: {0}")]
54 ArityMismatch(String),
55 #[error("Expression evaluation failed: {0}")]
56 ExprEval(String),
57}