argumentation_values/error.rs
1//! Error types for argumentation-values.
2
3/// Errors produced by VAF operations.
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 /// Wrapped error from the underlying Dung framework operations.
7 #[error("dung error: {0}")]
8 Dung(#[from] argumentation::Error),
9
10 /// `objectively_accepted` / `subjectively_accepted` bail out when the
11 /// audience contains too many distinct values for tractable enumeration
12 /// of all linear extensions of the partial order. The hard limit is 6
13 /// values (= 720 linear extensions in the worst case).
14 #[error("audience too large for exhaustive enumeration: {values} values (limit is {limit})")]
15 AudienceTooLarge {
16 /// Number of distinct values in the audience.
17 values: usize,
18 /// Hard cap on values past which we refuse to enumerate.
19 limit: usize,
20 },
21
22 /// An argument referenced by `ValueAssignment::promote` or by an attack
23 /// edge is not registered in the underlying framework.
24 #[error("argument not in framework: {0}")]
25 ArgumentNotFound(String),
26
27 /// APX text input failed to parse (Phase 3).
28 #[error("apx parse error at line {line}: {reason}")]
29 ApxParse {
30 /// 1-indexed line number where parsing failed.
31 line: usize,
32 /// What went wrong.
33 reason: String,
34 },
35}