Alerting Unification: Use the errors from grafana/alerting in Alerts (#61425)
This commit is contained in:
@@ -146,7 +146,7 @@ func (srv AlertmanagerSrv) RouteGetAMAlertGroups(c *models.ReqContext) response.
|
||||
c.Query("receiver"),
|
||||
)
|
||||
if err != nil {
|
||||
if errors.Is(err, notifier.ErrGetAlertGroupsBadPayload) {
|
||||
if errors.Is(err, alerting.ErrGetAlertGroupsBadPayload) {
|
||||
return ErrResp(http.StatusBadRequest, err, "")
|
||||
}
|
||||
// any other error here should be an unexpected failure and thus an internal error
|
||||
@@ -170,10 +170,10 @@ func (srv AlertmanagerSrv) RouteGetAMAlerts(c *models.ReqContext) response.Respo
|
||||
c.Query("receiver"),
|
||||
)
|
||||
if err != nil {
|
||||
if errors.Is(err, notifier.ErrGetAlertsBadPayload) {
|
||||
if errors.Is(err, alerting.ErrGetAlertsBadPayload) {
|
||||
return ErrResp(http.StatusBadRequest, err, "")
|
||||
}
|
||||
if errors.Is(err, notifier.ErrGetAlertsUnavailable) {
|
||||
if errors.Is(err, alerting.ErrGetAlertsUnavailable) {
|
||||
return ErrResp(http.StatusServiceUnavailable, err, "")
|
||||
}
|
||||
// any other error here should be an unexpected failure and thus an internal error
|
||||
|
||||
Reference in New Issue
Block a user