From 60c7c69312d5dc7969291a08e389b454cebd8339 Mon Sep 17 00:00:00 2001
From: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Date: Thu, 13 Oct 2022 09:50:59 -0400
Subject: [PATCH] cleanup Slack error logging (#25902)

---
 src/metabase/integrations/slack.clj | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/metabase/integrations/slack.clj b/src/metabase/integrations/slack.clj
index f242c242faa..e298e0e141b 100644
--- a/src/metabase/integrations/slack.clj
+++ b/src/metabase/integrations/slack.clj
@@ -91,9 +91,8 @@
       ;; being used)
       (when (slack-token-valid?) (messages/send-slack-token-error-emails!))
       (slack-token-valid?! false))
-    (if invalid-token?
-      (log/warn (u/pprint-to-str 'red (trs "🔒 Your Slack authorization token is invalid or has been revoked. Please update your integration in Admin Settings -> Slack.")))
-      (log/warn (u/pprint-to-str 'red error)))
+    (when invalid-token?
+      (log/warn (u/pprint-to-str 'red (trs "🔒 Your Slack authorization token is invalid or has been revoked. Please update your integration in Admin Settings -> Slack."))))
     (throw (ex-info message error))))
 
 (defn- handle-response [{:keys [status body]}]
@@ -122,7 +121,7 @@
         (try
           (handle-response (request-fn url request))
           (catch Throwable e
-            (throw (ex-info (.getMessage e) (merge (ex-data e) {:url url, :request request}) e))))))))
+            (throw (ex-info (.getMessage e) (merge (ex-data e) {:url url}) e))))))))
 
 (defn- GET
   "Make a GET request to the Slack API."
-- 
GitLab