1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use thiserror;

#[derive(PartialEq, Debug, Clone, thiserror::Error)]
pub enum Error {
    #[error("A label {0} is not defined.")]
    LabelNotDefined(String),

    #[error("Undefined variable: `{0}` at {1}")]
    UndefinedVariable(String, &'static str),

    #[error("Bug: {message:?} at {file:?}:{line:?}")]
    Bug {
        message: String,
        file: &'static str,
        line: u32,
    },

    // For non-local exists
    #[error("")]
    DoNothing,
}