fix: Rescue slack ChannelNotFound error (#8196)

This commit is contained in:
Muhsin Keloth
2023-10-25 13:53:30 +05:30
committed by GitHub
parent 9551dbc25f
commit 7438f3b157

View File

@@ -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