From aab67fd678c14b044f32f4526db4dffdf6dbcf5d Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Wed, 28 Jun 2023 18:09:26 +1000 Subject: [PATCH] Improve error --- valuescript_vm/src/operations.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/valuescript_vm/src/operations.rs b/valuescript_vm/src/operations.rs index b099cfe1..f6661bce 100644 --- a/valuescript_vm/src/operations.rs +++ b/valuescript_vm/src/operations.rs @@ -124,7 +124,16 @@ pub fn op_eq_impl(left: &Val, right: &Val) -> Result { (Val::Number(left_number), Val::Number(right_number)) => left_number == right_number, (Val::String(left_string), Val::String(right_string)) => left_string == right_string, (Val::BigInt(left_bigint), Val::BigInt(right_bigint)) => left_bigint == right_bigint, - _ => return Err("TODO: op== with other types".to_error()), + _ => { + return Err( + format!( + "TODO: op== with other types ({}, {})", + left.codify(), + right.codify() + ) + .to_error(), + ) + } }) }