git.delta.rocks / jrsonnet / refs/commits / 9b331948fca2

difftreelog

source

crates/jsonnet-evaluator/src/error.rs901 Bsourcehistory
1use crate::ValType;2use jsonnet_parser::LocExpr;34#[derive(Debug)]5pub enum Error {6	VariableIsNotDefined(String),7	TypeMismatch(&'static str, Vec<ValType>, ValType),8	NoSuchField(String),910	UnknownVariable(String),1112	UnknownFunctionParameter(String),13	BindingParameterASecondTime(String),14	TooManyArgsFunctionHas(usize),15	FunctionParameterNotBoundInCall(String),1617	UndefinedExternalVariable(String),1819	FieldMustBeStringGot(ValType),2021	AttemptedIndexAnArrayWithString(String),22	ValueIndexMustBeTypeGot(ValType, ValType, ValType),23	CantIndexInto(ValType),2425	RuntimeError(String),26	StackOverflow,27	FractionalIndex,28	DivisionByZero,29}3031#[derive(Clone, Debug)]32pub struct StackTraceElement(pub LocExpr, pub String);33#[derive(Debug)]34pub struct StackTrace(pub Vec<StackTraceElement>);3536#[derive(Debug)]37pub struct LocError(pub Error, pub StackTrace);38pub type Result<V> = std::result::Result<V, LocError>;