aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-03-14 12:55:48 -0500
committerCraig Jennings <c@cjennings.net>2026-03-14 12:55:48 -0500
commitb10322923a0f1c1a801fd67f3aaf4217acb74362 (patch)
tree61c70f6abb8cbc2cd236334839b93d72b69bf0a1 /modules
parent3d7dfc9c8cdbff1c024c0f22180ea633a90b7100 (diff)
downloaddotemacs-b10322923a0f1c1a801fd67f3aaf4217acb74362.tar.gz
dotemacs-b10322923a0f1c1a801fd67f3aaf4217acb74362.zip
fix(slack): add error visibility to notification handler
Websocket library silently swallows callback errors via condition-case. Wrap cj/slack-notify in condition-case to surface errors in *Messages*. Add cj/slack-test-notify command for pipeline verification.
Diffstat (limited to 'modules')
-rw-r--r--modules/slack-config.el28
1 files changed, 20 insertions, 8 deletions
diff --git a/modules/slack-config.el b/modules/slack-config.el
index 2b97a07c9..6260583fe 100644
--- a/modules/slack-config.el
+++ b/modules/slack-config.el
@@ -92,14 +92,26 @@
(defun cj/slack-notify (message room team)
"Send desktop notification for DMs and @mentions only.
MESSAGE is the incoming slack message, ROOM is the channel/DM,
-TEAM is the slack team object."
- (when (and (not (slack-message-minep message team))
- (or (slack-im-p room)
- (slack-message-mentioned-p message team)))
- (let ((title (format "Slack: %s" (slack-room-display-name room team)))
- (body (slack-message-body message team)))
- (start-process "slack-notify" nil
- "notify" "info" title body))))
+TEAM is the slack team object.
+Errors are logged to *Messages* since the websocket library silently
+swallows exceptions via `websocket-try-callback'."
+ (condition-case err
+ (when (and (not (slack-message-minep message team))
+ (or (slack-im-p room)
+ (slack-message-mentioned-p message team)))
+ (let ((title (format "Slack: %s" (slack-room-display-name room team)))
+ (body (or (slack-message-body message team) "")))
+ (start-process "slack-notify" nil
+ "notify" "info" title body)))
+ (error (message "cj/slack-notify error: %S" err))))
+
+(defun cj/slack-test-notify ()
+ "Send a test desktop notification to verify the notify pipeline works."
+ (interactive)
+ (condition-case err
+ (start-process "slack-notify-test" nil
+ "notify" "info" "Slack: Test" "Notification pipeline works")
+ (error (message "cj/slack-test-notify error: %S" err))))
(defun cj/slack-mark-read-and-bury ()
"Mark the current Slack channel as read and bury the buffer."