From c9c0dd1ea8a0c6089a326f2526cc394df7e25d3d Mon Sep 17 00:00:00 2001 From: lzd Date: Mon, 9 Sep 2019 20:09:21 +0800 Subject: [PATCH] Alerting: fix response popover prompt when add notification channels (#18967) --- pkg/services/alerting/notifier.go | 2 ++ public/app/features/alerting/NotificationsEditCtrl.ts | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go index 630c5ed6dae..baec212fc6e 100644 --- a/pkg/services/alerting/notifier.go +++ b/pkg/services/alerting/notifier.go @@ -64,6 +64,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no if err != nil { n.log.Error("failed to send notification", "uid", notifier.GetNotifierUID(), "error", err) metrics.MAlertingNotificationFailed.WithLabelValues(notifier.GetType()).Inc() + return err } if evalContext.IsTestRun { @@ -108,6 +109,7 @@ func (n *notificationService) sendNotifications(evalContext *EvalContext, notifi err := n.sendNotification(evalContext, notifierState) if err != nil { n.log.Error("failed to send notification", "uid", notifierState.notifier.GetNotifierUID(), "error", err) + return err } } diff --git a/public/app/features/alerting/NotificationsEditCtrl.ts b/public/app/features/alerting/NotificationsEditCtrl.ts index f9d336c5c6e..f0f11fce606 100644 --- a/public/app/features/alerting/NotificationsEditCtrl.ts +++ b/public/app/features/alerting/NotificationsEditCtrl.ts @@ -121,9 +121,7 @@ export class AlertNotificationEditCtrl { settings: this.model.settings, }; - this.backendSrv.post(`/api/alert-notifications/test`, payload).then((res: any) => { - appEvents.emit('alert-success', ['Test notification sent', '']); - }); + this.backendSrv.post(`/api/alert-notifications/test`, payload); } }