pub enum ErrorKind {
Show 41 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(Option<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>,
},
JsonError(String),
NotSerialisableToJson(&'static str),
FromTomlError(String),
UnexpectedArgumentBuiltin(NixString),
UnexpectedArgumentFormals {
arg: NixString,
formals_span: Span,
},
Utf8,
InvalidHash(String),
TvixError(Rc<dyn Error>),
TvixBug {
msg: &'static str,
metadata: Option<Rc<dyn Debug>>,
},
NotImplemented(&'static str),
WithContext {
context: String,
underlying: Box<ErrorKind>,
},
UnexpectedContext,
CatchableError(CatchableErrorKind),
UnknownHashType(String),
}
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(Option<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
JsonError(String)
Errors parsing JSON, or serializing as JSON.
NotSerialisableToJson(&'static str)
Nix value that can not be serialised to JSON.
FromTomlError(String)
Errors converting TOML to a value
UnexpectedArgumentBuiltin(NixString)
An unexpected argument was supplied to a builtin
UnexpectedArgumentFormals
An unexpected argument was supplied to a function that takes formal parameters
Utf8
Invalid UTF-8 was encoutered somewhere
InvalidHash(String)
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.
UnexpectedContext
Unexpected context string
CatchableError(CatchableErrorKind)
Top-level evaluation result was a catchable Nix error, and should fail the evaluation.
This variant must only be used at the top-level of tvix-eval when returning a result to the user, never inside of eval code.
UnknownHashType(String)
Invalid hash type specified, must be one of “md5”, “sha1”, “sha256” or “sha512”
Trait Implementations§
source§impl AddContext for ErrorKind
impl AddContext for ErrorKind
source§impl Error for ErrorKind
impl Error for ErrorKind
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<FromUtf8Error> for ErrorKind
impl From<FromUtf8Error> for ErrorKind
source§fn from(_: FromUtf8Error) -> Self
fn from(_: FromUtf8Error) -> Self
source§impl From<FromUtf8Error> for ErrorKind
impl From<FromUtf8Error> for ErrorKind
source§fn from(_value: FromUtf8Error) -> Self
fn from(_value: FromUtf8Error) -> Self
source§impl From<ParseIntError> for ErrorKind
impl From<ParseIntError> for ErrorKind
source§fn from(e: ParseIntError) -> Self
fn from(e: ParseIntError) -> Self
Auto Trait Implementations§
impl Freeze for ErrorKind
impl !RefUnwindSafe for ErrorKind
impl !Send for ErrorKind
impl !Sync for ErrorKind
impl Unpin for ErrorKind
impl !UnwindSafe for ErrorKind
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more