promtool range query should exit when fail to parse time (#7505)

Signed-off-by: yeya24 <yb532204897@gmail.com>
pull/7596/head
Ben Ye 4 years ago committed by GitHub
parent b489f78f68
commit e6ea798c32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {

Loading…
Cancel
Save