diff --git a/.changeset/sad-rockets-rule.md b/.changeset/sad-rockets-rule.md new file mode 100644 index 0000000000..fe15580f99 --- /dev/null +++ b/.changeset/sad-rockets-rule.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-notifications-backend-module-slack': patch +--- + +When an error message is logged due to inability to send a message with the Slack SDK, include the Slack Channel ID in the message to aid debugging. diff --git a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts index 96d4b2ff3e..f9b00c9a58 100644 --- a/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts +++ b/plugins/notifications-backend-module-slack/src/lib/SlackNotificationProcessor.ts @@ -148,12 +148,12 @@ export class SlackNotificationProcessor implements NotificationProcessor { let successCount = 0; let failureCount = 0; - results.forEach(result => { + results.forEach((result, index) => { if (result.status === 'fulfilled') { successCount++; } else { this.logger.error( - `Failed to send Slack channel notification: ${result.reason.message}`, + `Failed to send Slack channel notification to ${opts[index].channel}: ${result.reason.message}`, ); failureCount++; }