Skip to main content

argumentation/
error.rs

1//! Crate error types.
2
3use thiserror::Error;
4
5/// Errors that can occur in the `argumentation` crate.
6#[derive(Debug, Error)]
7pub enum Error {
8    /// An argument referenced in an operation was not present in the framework.
9    /// The payload is a `Debug` rendering of the missing argument when available.
10    #[error("argument not found: {0}")]
11    ArgumentNotFound(String),
12
13    /// A parser failed to decode input.
14    #[error("parse error: {0}")]
15    Parse(String),
16
17    /// An ASPIC+ operation failed structurally (e.g., cyclic rule dependencies,
18    /// rule references a literal not in the language).
19    #[error("aspic error: {0}")]
20    Aspic(String),
21
22    /// An extension-enumeration call was rejected because the framework is too
23    /// large for the subset-enumeration algorithm. Use a SAT-based semantics
24    /// entry point (future) for frameworks above this threshold.
25    #[error("framework too large for subset enumeration: {arguments} arguments (limit is {limit})")]
26    TooLarge {
27        /// Number of arguments in the framework.
28        arguments: usize,
29        /// Enumeration limit (currently 22, see [`crate::ENUMERATION_LIMIT`]).
30        limit: usize,
31    },
32}