From bd63699d63f09edcac1205f407c1b3576d710102 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Wed, 20 May 2015 10:43:53 +1000
Subject: [PATCH] FIX: rescue even more errors in case avatar has issues
 downloading

---
 app/models/discourse_single_sign_on.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/discourse_single_sign_on.rb b/app/models/discourse_single_sign_on.rb
index db2387923aa..41e71826b88 100644
--- a/app/models/discourse_single_sign_on.rb
+++ b/app/models/discourse_single_sign_on.rb
@@ -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