chore: Fix sentry issues (#4940)

Fixes: #4810
This commit is contained in:
Aswin Dev P.S 2022-07-08 15:09:06 +05:30 committed by GitHub
parent ef1d117717
commit 19c637eb33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -9,8 +9,10 @@ class Inboxes::FetchImapEmailsJob < ApplicationJob
fetch_mail_for_channel(channel)
# clearing old failures like timeouts since the mail is now successfully processed
channel.reauthorized!
rescue Errno::ECONNREFUSED, Net::OpenTimeout, Net::IMAP::NoResponseError
rescue Errno::ECONNREFUSED, Net::OpenTimeout, Net::IMAP::NoResponseError, Errno::ECONNRESET, Errno::ENETUNREACH, Net::IMAP::ByeResponseError
channel.authorization_error!
rescue EOFError => e
Rails.logger.error e
rescue StandardError => e
ChatwootExceptionTracker.new(e, account: channel.account).capture_exception
end

View file

@ -35,7 +35,7 @@ module MailboxHelper
def create_contact
@contact_inbox = ::ContactBuilder.new(
source_id: "email:#{processed_mail.message_id}",
source_id: processed_mail.original_sender,
inbox: @inbox,
contact_attributes: {
name: identify_contact_name,