Skip to main content

harper_core/weir/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error, Eq, PartialEq)]
4pub enum Error {
5    #[error("Encountered a token that is unsupported by the parser.")]
6    UnsupportedToken(String),
7    #[error("Reached the end of the input token stream prematurely.")]
8    EndOfInput,
9    #[error("Unmatched brace")]
10    UnmatchedBrace,
11    #[error("Expected a comma here.")]
12    ExpectedComma,
13    #[error("Expected a valid keyword. Got: {0}")]
14    UnexpectedToken(String),
15    #[error("Expected a value to be defined.")]
16    ExpectedVariableUndefined,
17    #[error("Invalid LintKind")]
18    InvalidLintKind,
19    #[error("Invalid Replacement Strategy")]
20    InvalidReplacementStrategy,
21    #[error("Expected a variable type other than the one provided.")]
22    ExpectedDifferentVariableType,
23    #[error("Unable to resolve expression reference {0}")]
24    UnableToResolveExpr(String),
25}