1use crate::ValType;2use jsonnet_parser::LocExpr;3use std::path::PathBuf;45#[derive(Debug, Clone)]6pub enum Error {7 VariableIsNotDefined(String),8 TypeMismatch(&'static str, Vec<ValType>, ValType),9 NoSuchField(String),1011 UnknownVariable(String),1213 UnknownFunctionParameter(String),14 BindingParameterASecondTime(String),15 TooManyArgsFunctionHas(usize),16 FunctionParameterNotBoundInCall(String),1718 UndefinedExternalVariable(String),1920 FieldMustBeStringGot(ValType),2122 AttemptedIndexAnArrayWithString(String),23 ValueIndexMustBeTypeGot(ValType, ValType, ValType),24 CantIndexInto(ValType),2526 StandaloneSuper,2728 ImportFileNotFound(PathBuf, PathBuf),29 ResolvedFileNotFound(PathBuf),30 ImportBadFileUtf8(PathBuf),31 ImportNotSupported(PathBuf, PathBuf),32 ImportSyntaxError(jsonnet_parser::ParseError),3334 RuntimeError(String),35 StackOverflow,36 FractionalIndex,37 DivisionByZero,38}3940#[derive(Clone, Debug)]41pub struct StackTraceElement(pub LocExpr, pub String);42#[derive(Debug, Clone)]43pub struct StackTrace(pub Vec<StackTraceElement>);4445#[derive(Debug, Clone)]46pub struct LocError(pub Error, pub StackTrace);47pub type Result<V> = std::result::Result<V, LocError>;