From 59342128a904c688a6f3302484644f0e1eef4da8 Mon Sep 17 00:00:00 2001 From: discord9 Date: Mon, 26 Aug 2024 14:40:05 +0800 Subject: [PATCH] fix: report error when not literal --- src/flow/src/expr/func.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/flow/src/expr/func.rs b/src/flow/src/expr/func.rs index 7307668f6b4d..454cf5e70081 100644 --- a/src/flow/src/expr/func.rs +++ b/src/flow/src/expr/func.rs @@ -352,6 +352,8 @@ impl UnaryFunc { }.fail()? } }; + + // start time argument is optional let start_time = match args.get(2) { Some(start_time) => { if let Some(value) = start_time.expr.as_literal() { @@ -367,7 +369,10 @@ impl UnaryFunc { })?; Some(ret) } else { - None + UnexpectedSnafu { + reason: "Expect start time arg to be literal", + } + .fail()? } } None => None,