From 7438f3b157da834351a756744d6e86ab5f8e5d22 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 25 Oct 2023 13:53:30 +0530 Subject: [PATCH] fix: Rescue slack `ChannelNotFound` error (#8196) --- lib/integrations/slack/send_on_slack_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/integrations/slack/send_on_slack_service.rb b/lib/integrations/slack/send_on_slack_service.rb index 7892ea92e..fc7ffe5ab 100644 --- a/lib/integrations/slack/send_on_slack_service.rb +++ b/lib/integrations/slack/send_on_slack_service.rb @@ -92,7 +92,8 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService def send_message post_message if message_content.present? upload_file if message.attachments.any? - rescue Slack::Web::Api::Errors::AccountInactive, Slack::Web::Api::Errors::MissingScope, Slack::Web::Api::Errors::InvalidAuth => e + rescue Slack::Web::Api::Errors::AccountInactive, Slack::Web::Api::Errors::MissingScope, Slack::Web::Api::Errors::InvalidAuth, + Slack::Web::Api::Errors::ChannelNotFound => e Rails.logger.error e hook.prompt_reauthorization! hook.disable