API: Return 400 on invalid Annotation requests (#32429)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2021-03-29 15:47:16 +02:00
committed by GitHub
parent 636be0ed22
commit e1458391bb
3 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ import (
func validateTimeRange(item *annotations.Item) error {
if item.EpochEnd == 0 {
if item.Epoch == 0 {
return errors.New("missing time range")
return annotations.ErrTimerangeMissing
}
item.EpochEnd = item.Epoch
}