mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Sort RefIDs in error message returned by api.validateCondition (#70198)
sort RefIDs in error message
This commit is contained in:
parent
b963defa44
commit
f1d47d18a8
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -135,6 +136,7 @@ func validateCondition(condition string, queries []apimodels.AlertQuery) error {
|
||||
for id := range refIDs {
|
||||
ids = append(ids, id)
|
||||
}
|
||||
sort.Strings(ids)
|
||||
return fmt.Errorf("condition %s does not exist, must be one of [%s]", condition, strings.Join(ids, ","))
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user