swamp_script_eval/
err.rs

1/*
2 * Copyright (c) Peter Bjorklund. All rights reserved. https://github.com/swamp/script
3 * Licensed under the MIT License. See LICENSE in the project root for license information.
4 */
5use swamp_script_core::value::ValueError;
6use swamp_script_semantic::{ExternalFunctionId, ResolvedNode};
7
8#[derive(Debug, PartialEq, Eq)]
9pub enum ConversionError {
10    TypeError(String),
11    ValueError(String),
12}
13
14#[derive(Debug, PartialEq, Eq)]
15pub enum ExecuteError {
16    Error(String),
17    TypeError(String),
18    ConversionError(ConversionError),
19    ValueError(ValueError),
20    ArgumentIsNotMutable(ResolvedNode),
21    CanNotUnwrap,
22    IllegalIterator,
23    ExpectedOptional,
24    NonUniqueKeysInMapLiteralDetected,
25    NotAnArray,
26    ValueIsNotMutable,
27    NotSparseValue,
28    CoerceOptionToBoolFailed,
29    VariableWasNotMutable,
30    ContinueNotAllowedHere,
31    BreakNotAllowedHere,
32    NotMutLocationFound,
33    IndexWasNotInteger,
34    NotAMap,
35    MissingExternalFunction(ExternalFunctionId),
36    ExpectedInt,
37    ExpectedString,
38    IncompatiableTypes,
39}