promtool range query should exit when fail to parse time (#7505)
Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
parent
b489f78f68
commit
e6ea798c32
|
@ -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…
Reference in New Issue