From e6ea798c324cda96b3f5e7e8b58057e5e2806db1 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Thu, 16 Jul 2020 22:53:04 +0000 Subject: [PATCH] promtool range query should exit when fail to parse time (#7505) Signed-off-by: yeya24 --- cmd/promtool/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/promtool/main.go b/cmd/promtool/main.go index 4c7af395c..e7085d1eb 100644 --- a/cmd/promtool/main.go +++ b/cmd/promtool/main.go @@ -455,11 +455,13 @@ func QueryRange(url string, headers map[string]string, query, start, end string, stime, err = parseTime(start) if err != nil { fmt.Fprintln(os.Stderr, "error parsing start time:", err) + return 1 } } if !stime.Before(etime) { fmt.Fprintln(os.Stderr, "start time is not before end time") + return 1 } if step == 0 {