git.delta.rocks / jrsonnet / refs/commits / f8b60736ba96

difftreelog

source

crates/jsonnet-evaluator/src/error.rs874 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	UnknownFunctionParameter(String),11	BindingParameterASecondTime(String),12	TooManyArgsFunctionHas(usize),13	FunctionParameterNotBoundInCall(String),1415	UndefinedExternalVariable(String),1617	FieldMustBeStringGot(ValType),1819	AttemptedIndexAnArrayWithString(String),20	ValueIndexMustBeTypeGot(ValType, ValType, ValType),21	CantIndexInto(ValType),2223	RuntimeError(String),24	StackOverflow,25	FractionalIndex,26	DivisionByZero,27}2829#[derive(Clone, Debug)]30pub struct StackTraceElement(pub LocExpr, pub String);31#[derive(Debug)]32pub struct StackTrace(pub Vec<StackTraceElement>);3334#[derive(Debug)]35pub struct LocError(pub Error, pub StackTrace);36pub type Result<V> = std::result::Result<V, LocError>;