chore: Handle exceptions on external URL calls (#1334)

This commit is contained in:
Sojan Jose
2020-10-11 20:22:21 +05:30
committed by GitHub
parent 7d409321e9
commit 59bee66e63
6 changed files with 9 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ class Api::V1::Accounts::CallbacksController < Api::V1::Accounts::BaseController
avatar_resource = LocalResource.new(uri)
facebook_inbox.avatar.attach(io: avatar_resource.file, filename: avatar_resource.tmp_filename, content_type: avatar_resource.encoding)
rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, SocketError => e
rescue *ExceptionList::URI_EXCEPTIONS => e
Rails.logger.info "invalid url #{file_url} : #{e.message}"
end