about summary refs log tree commit diff
path: root/tvix/eval/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/errors.rs')
-rw-r--r--tvix/eval/src/errors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs
index 6331ee64be..10bc9276ad 100644
--- a/tvix/eval/src/errors.rs
+++ b/tvix/eval/src/errors.rs
@@ -31,6 +31,9 @@ pub enum ErrorKind {
         index: i64,
     },
 
+    /// Attempted to call `builtins.tail` on an empty list.
+    TailEmptyList,
+
     TypeError {
         expected: &'static str,
         actual: &'static str,
@@ -150,6 +153,8 @@ impl Error {
                 format!("list index '{}' is out of bounds", index)
             }
 
+            ErrorKind::TailEmptyList => format!("'tail' called on an empty list"),
+
             ErrorKind::TypeError { expected, actual } => format!(
                 "expected value of type '{}', but found a '{}'",
                 expected, actual
@@ -257,6 +262,7 @@ to a missing value in the attribute set(s) included via `with`."#,
             ErrorKind::NotAnAbsolutePath(_) => "E020",
             ErrorKind::ParseIntError(_) => "E021",
             ErrorKind::NegativeLength { .. } => "E022",
+            ErrorKind::TailEmptyList { .. } => "E023",
             ErrorKind::NotImplemented(_) => "E999",
         }
     }