Skip to content

Commit

Permalink
Merge pull request #14 from 2hire/split-slack-attachments
Browse files Browse the repository at this point in the history
fix: changed import to the actual json framework
  • Loading branch information
AGreenPlace authored Oct 10, 2023
2 parents 0baac59 + fb62834 commit 13ad292
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn precommit
./hooks/pre-commit.nocommit
# yarn precommit
# ./hooks/pre-commit.nocommit
5 changes: 4 additions & 1 deletion src/metabase/pulse.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns metabase.pulse
"Public API for sending Pulses."
(:require
[cheshire.core :as json]
[clojure.string :as str]
[metabase.api.common :as api]
[metabase.config :as config]
Expand Down Expand Up @@ -531,11 +532,13 @@
[{:keys [channel-id message attachments]}]
(let [attachments (create-and-upload-slack-attachments! attachments)]
(try
(log/error "TestNonLoop" (trs "Sending Slack message with {0} attachments" (count attachments)))
(log/error "TestNonLoop" (trs "Sending Slack message with {0} attachments: {1}" (count attachments) (json/generate-string attachments)))
(slack/post-chat-message! channel-id message attachments)
(catch ExceptionInfo e
;; Token errors have already been logged and we should not retry.
(when-not (contains? (:errors (ex-data e)) :slack-token)
;; Logging errors here for debug
(log/error e (trs "Error sending Slack message with {0} attachments" (count attachments)))
(throw e))))))

(defmethod send-notification! :email
Expand Down

0 comments on commit 13ad292

Please sign in to comment.