Skip to main content

opql/error/
kind.rs

1use super::*;
2
3#[derive(Debug, Clone, PartialEq, Eq, derive_more::From)]
4pub enum PQLErrorKind {
5    // Parsing
6    SyntaxError(SyntaxError),
7    ParseError(ParseError),
8    RangeError(RangeError),
9
10    // Name resolution
11    UnrecognizedFunction,
12    UnrecognizedIdentifier,
13
14    // Type and arity checks
15    TypeError {
16        given: PQLType,
17        expected: PQLType,
18    },
19    WrongNumberOfArguments {
20        given: usize,
21        expected: usize,
22    },
23    #[from(skip)]
24    ArithmeticOperationUnsupported {
25        lhs: PQLType,
26        rhs: PQLType,
27    },
28    #[from(skip)]
29    ComparisonOperationUnsupported {
30        lhs: PQLType,
31        rhs: PQLType,
32    },
33    #[from(skip)]
34    LogicalOperationUnsupported {
35        lhs: PQLType,
36        rhs: PQLType,
37    },
38
39    // Input validation
40    ExceededMaximumPlayers(usize),
41    InvalidPlayer,
42    InvalidDeadcards,
43    InvalidCardCount,
44
45    // Execution
46    Internal(InternalError),
47    Runtime(RuntimeError),
48    Vm(VmError),
49}