fix: Rescue InvalidAuth and mark integration as inactive (#7797)

This commit is contained in:
Pranav Raj S
2023-08-24 04:32:24 -07:00
committed by GitHub
parent f451e59aec
commit 3dd3b7b3aa

View File

@@ -80,7 +80,7 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
def send_message def send_message
post_message if message_content.present? post_message if message_content.present?
upload_file if message.attachments.any? upload_file if message.attachments.any?
rescue Slack::Web::Api::Errors::AccountInactive, Slack::Web::Api::Errors::MissingScope => e rescue Slack::Web::Api::Errors::AccountInactive, Slack::Web::Api::Errors::MissingScope, Slack::Web::Api::Errors::InvalidAuth => e
Rails.logger.error e Rails.logger.error e
hook.prompt_reauthorization! hook.prompt_reauthorization!
hook.disable hook.disable