diff --git a/query-algebrizer/src/clauses/resolve.rs b/query-algebrizer/src/clauses/resolve.rs index 58e0d902..bb8ae199 100644 --- a/query-algebrizer/src/clauses/resolve.rs +++ b/query-algebrizer/src/clauses/resolve.rs @@ -59,7 +59,7 @@ impl ConjoiningClauses { Constant(NonIntegerConstant::BigInteger(_)) | Vector(_) => { self.mark_known_empty(EmptyBecause::NonNumericArgument); - bail!(ErrorKind::NonNumericArgument(function.clone(), position)); + bail!(ErrorKind::InvalidArgument(function.clone(), "numeric", position)); }, Constant(NonIntegerConstant::Float(f)) => Ok(QueryValue::TypedValue(TypedValue::Double(f))), } diff --git a/query-algebrizer/src/errors.rs b/query-algebrizer/src/errors.rs index b76f5ac5..0c93011d 100644 --- a/query-algebrizer/src/errors.rs +++ b/query-algebrizer/src/errors.rs @@ -42,9 +42,10 @@ error_chain! { display("unbound variable: {}", name) } - NonNumericArgument(function: PlainSymbol, position: usize) { + + InvalidArgument(function: PlainSymbol, expected_type: &'static str, position: usize) { description("invalid argument") - display("invalid argument to {}: expected numeric in position {}.", function, position) + display("invalid argument to {}: expected {} in position {}.", function, expected_type, position) } InvalidLimit(val: String, kind: ValueType) {