Skip to content
Snippets Groups Projects
Unverified Commit 7b1ff963 authored by Cam Saul's avatar Cam Saul
Browse files

If sending a Slack pulse/alert fails, still send email pulse/alert (#7409)

parent bf9f1023
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
[metabase.util [metabase.util
[ui-logic :as ui] [ui-logic :as ui]
[urls :as urls]] [urls :as urls]]
[metabase.util.urls :as urls] [puppetlabs.i18n.core :refer [trs tru]]
[puppetlabs.i18n.core :refer [tru]]
[schema.core :as s] [schema.core :as s]
[toucan.db :as db]) [toucan.db :as db])
(:import java.util.TimeZone (:import java.util.TimeZone
...@@ -212,7 +211,12 @@ ...@@ -212,7 +211,12 @@
(defn- send-notifications! [notifications] (defn- send-notifications! [notifications]
(doseq [notification notifications] (doseq [notification notifications]
(send-notification! notification))) ;; do a try-catch around each notification so if one fails, we'll still send the other ones for example, an Alert
;; set up to send over both Slack & email: if Slack fails, we still want to send the email (#7409)
(try
(send-notification! notification)
(catch Throwable e
(log/error e (trs "Error sending notification!"))))))
(defn- pulse->notifications [{:keys [cards channel-ids], :as pulse}] (defn- pulse->notifications [{:keys [cards channel-ids], :as pulse}]
(let [results (for [card cards (let [results (for [card cards
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment