chore: Rescue slack link unfurling errors. (#11033)
Fixes https://linear.app/chatwoot/issue/CW-4122/slackwebapierrorsmissingscope-missing-scope This PR adds the ability to handle errors when scopes are missing during link unfurling. Since link unfurling is just a nice-to-have feature that doesn't affect core functionality, we will silently ignore these errors. --------- Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -18,6 +18,10 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
|
||||
slack_client.chat_unfurl(
|
||||
event
|
||||
)
|
||||
# You may wonder why we're not requesting reauthorization and disabling hooks when scope errors occur.
|
||||
# Since link unfurling is just a nice-to-have feature that doesn't affect core functionality, we will silently ignore these errors.
|
||||
rescue Slack::Web::Api::Errors::MissingScope => e
|
||||
Rails.logger.warn "Slack: Missing scope error: #{e.message}"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user