FIX: rescue even more errors in case avatar has issues downloading

This commit is contained in:
Sam 2015-05-20 10:43:53 +10:00
parent cf90550cf1
commit bd63699d63
1 changed files with 2 additions and 2 deletions

View File

@ -143,9 +143,9 @@ class DiscourseSingleSignOn < SingleSignOn
if !user.user_avatar.contains_upload?(upload.id)
user.user_avatar.custom_upload_id = upload.id
end
rescue SocketError
rescue => e
# skip saving, we are not connected to the net
Rails.logger.warn "Failed to download external avatar: #{avatar_url}, socket error - user id #{ user.id }"
Rails.logger.warn "#{e}: Failed to download external avatar: #{avatar_url}, user id #{ user.id }"
ensure
tempfile.close! if tempfile && tempfile.respond_to?(:close!)
end