Compare commits

...
2 changed files with 12 additions and 0 deletions
@@ -33,6 +33,16 @@ class Instagram::Messenger::MessageText < Instagram::BaseMessageText
return
end
# Handle error code 9010: No matching Instagram user
# This occurs when trying to fetch an Instagram user that doesn't exist or is not accessible
# We can safely ignore this error and return empty result
if error.message.include?('9010')
Rails.logger.warn("[Instagram User Not Found]: account_id #{@inbox.account_id} inbox_id #{@inbox.id}")
Rails.logger.warn("[Instagram User Not Found]: #{error.message}")
Rails.logger.warn("[Instagram User Not Found]: #{error}")
return
end
Rails.logger.warn("[FacebookUserFetchClientError]: account_id #{@inbox.account_id} inbox_id #{@inbox.id}")
Rails.logger.warn("[FacebookUserFetchClientError]: #{error.message}")
ChatwootExceptionTracker.new(error, account: @inbox.account).capture_exception
@@ -71,6 +71,8 @@ class Notification::PushNotificationService
rescue WebPush::ExpiredSubscription, WebPush::InvalidSubscription, WebPush::Unauthorized => e
Rails.logger.info "WebPush subscription expired: #{e.message}"
subscription.destroy!
rescue WebPush::TooManyRequests => e
Rails.logger.warn "WebPush rate limited for #{user.email} on account #{notification.account.id}: #{e.message}"
rescue Errno::ECONNRESET, Net::OpenTimeout, Net::ReadTimeout => e
Rails.logger.error "WebPush operation error: #{e.message}"
rescue StandardError => e