Skip to content

Commit

Permalink
fix: Handle error if the Twillio attachment download fails to download (
Browse files Browse the repository at this point in the history
  • Loading branch information
muhsin-k committed Jan 15, 2024
1 parent 22db201 commit 52a5a59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/services/twilio/incoming_message_service.rb
Expand Up @@ -109,6 +109,8 @@ def attach_files

attachment_file = download_attachment_file

return if attachment_file.blank?

attachment = @message.attachments.new(
account_id: @message.account_id,
file_type: file_type(params[:MediaContentType0])
Expand Down Expand Up @@ -144,6 +146,7 @@ def handle_download_attachment_error(error)
Down.download(params[:MediaUrl0])
else
ChatwootExceptionTracker.new(error, account: @inbox.account).capture_exception
nil
end
end
end

0 comments on commit 52a5a59

Please sign in to comment.