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 8f782cb86151..ba9d6cb98ba6 100644
--- a/tvix/eval/src/errors.rs
+++ b/tvix/eval/src/errors.rs
@@ -20,6 +20,8 @@ pub enum ErrorKind {
     Abort(String),
     AssertionFailed,
 
+    DivisionByZero,
+
     DuplicateAttrsKey {
         key: String,
     },
@@ -215,6 +217,8 @@ impl Display for Error {
             ErrorKind::Abort(msg) => write!(f, "evaluation aborted: {}", msg),
             ErrorKind::AssertionFailed => write!(f, "assertion failed"),
 
+            ErrorKind::DivisionByZero => write!(f, "division by zero"),
+
             ErrorKind::DuplicateAttrsKey { key } => {
                 write!(f, "attribute key '{}' already defined", key)
             }
@@ -656,6 +660,7 @@ impl Error {
             | ErrorKind::TailEmptyList
             | ErrorKind::TypeError { .. }
             | ErrorKind::Incomparable { .. }
+            | ErrorKind::DivisionByZero
             | ErrorKind::DynamicKeyInScope(_)
             | ErrorKind::UnknownStaticVariable
             | ErrorKind::UnknownDynamicVariable(_)
@@ -717,6 +722,7 @@ impl Error {
             ErrorKind::FromJsonError { .. } => "E030",
             ErrorKind::UnexpectedArgument { .. } => "E031",
             ErrorKind::RelativePathResolution(_) => "E032",
+            ErrorKind::DivisionByZero => "E033",
 
             // Special error code that is not part of the normal
             // ordering.