pub enum ErrorKind {
Show 36 variants
Abort(String),
DivisionByZero,
DuplicateAttrsKey {
key: String,
},
InvalidAttributeName(Value),
AttributeNotFound {
name: String,
},
IndexOutOfBounds {
index: i64,
},
TailEmptyList,
TypeError {
expected: &'static str,
actual: &'static str,
},
Incomparable {
lhs: &'static str,
rhs: &'static str,
},
RelativePathResolution(String),
DynamicKeyInScope(&'static str),
UnknownStaticVariable,
UnknownDynamicVariable(String),
VariableAlreadyDefined(Span),
NotCallable(&'static str),
InfiniteRecursion {
first_force: Span,
suspended_at: Option<Span>,
content_span: Option<Span>,
},
ParseErrors(Vec<ParseError>),
NativeError {
gen_type: &'static str,
err: Box<Error>,
},
BytecodeError(Box<Error>),
NotCoercibleToString {
from: &'static str,
kind: CoercionKind,
},
NotAnAbsolutePath(PathBuf),
ParseIntError(ParseIntError),
UnmergeableInherit {
name: SmolStr,
},
UnmergeableValue,
ImportParseError {
path: PathBuf,
file: Arc<File>,
errors: Vec<ParseError>,
},
ImportCompilerError {
path: PathBuf,
errors: Vec<Error>,
},
IO {
path: Option<PathBuf>,
error: Rc<Error>,
},
FromJsonError(String),
NotSerialisableToJson(&'static str),
FromTomlError(String),
UnexpectedArgument {
arg: NixString,
formals_span: Span,
},
Xml(Rc<Error>),
TvixError(Rc<dyn Error>),
TvixBug {
msg: &'static str,
metadata: Option<Rc<dyn Debug>>,
},
NotImplemented(&'static str),
WithContext {
context: String,
underlying: Box<ErrorKind>,
},
}
Variants§
Abort(String)
These are user-generated errors through builtins.
DivisionByZero
DuplicateAttrsKey
InvalidAttributeName(Value)
Attempted to specify an invalid key type (e.g. integer) in a dynamic attribute name.
AttributeNotFound
IndexOutOfBounds
Attempted to index into a list beyond its boundaries.
TailEmptyList
Attempted to call builtins.tail
on an empty list.
TypeError
Incomparable
RelativePathResolution(String)
Resolving a user-supplied relative or home-relative path literal failed in some way.
DynamicKeyInScope(&'static str)
Dynamic keys are not allowed in some scopes.
UnknownStaticVariable
Unknown variable in statically known scope.
UnknownDynamicVariable(String)
Unknown variable in dynamic scope (with, rec, …).
VariableAlreadyDefined(Span)
User is defining the same variable twice at the same depth.
NotCallable(&'static str)
Attempt to call something that is not callable.
InfiniteRecursion
Infinite recursion encountered while forcing thunks.
ParseErrors(Vec<ParseError>)
NativeError
An error occured while executing some native code (e.g. a builtin), and needs to be chained up.
BytecodeError(Box<Error>)
An error occured while executing Tvix bytecode, but needs to be chained up.
NotCoercibleToString
Given type can’t be coerced to a string in the respective context
NotAnAbsolutePath(PathBuf)
The given string doesn’t represent an absolute path
ParseIntError(ParseIntError)
An error occurred when parsing an integer
UnmergeableInherit
Nested attributes can not be merged with an inherited value.
UnmergeableValue
Nested attributes can not be merged with values that are not literal attribute sets.
ImportParseError
Parse errors occured while importing a file.
ImportCompilerError
Compilation errors occured while importing a file.
IO
I/O errors
FromJsonError(String)
Errors converting JSON to a value
NotSerialisableToJson(&'static str)
Nix value that can not be serialised to JSON.
FromTomlError(String)
Errors converting TOML to a value
UnexpectedArgument
An unexpected argument was supplied to a function that takes formal parameters
Xml(Rc<Error>)
Errors while serialising to XML.
TvixError(Rc<dyn Error>)
Variant for errors that bubble up to eval from other Tvix components.
TvixBug
Variant for code paths that are known bugs in Tvix (usually issues with the compiler/VM interaction).
NotImplemented(&'static str)
Tvix internal warning for features triggered by users that are not actually implemented yet, and without which eval can not proceed.
WithContext
Internal variant which should disappear during error construction.