BUGFIX: no network could mean no posts save.

This commit is contained in:
Sam Saffron 2014-06-16 12:14:51 +10:00
parent 944cda1f73
commit 03cde003db

View file

@ -30,6 +30,9 @@ class UserAvatar < ActiveRecord::Base
end end
rescue OpenURI::HTTPError rescue OpenURI::HTTPError
save! save!
rescue SocketError
# skip saving, we are not connected to the net
Rails.logger.warn "Failed to download gravatar, socket error - user id #{ user.id }"
ensure ensure
tempfile.unlink if tempfile tempfile.unlink if tempfile
end end