FIX: rescue `avatars:refresh` rake task

FIX: rescue avatars:refresh rake task

diff --git a/lib/tasks/avatars.rake b/lib/tasks/avatars.rake
index f9bdf8e..28f84f8 100644
--- a/lib/tasks/avatars.rake
+++ b/lib/tasks/avatars.rake
@@ -6,8 +6,12 @@ task "avatars:refresh" => :environment do
   puts
 
   User.find_each do |user|
-    user.refresh_avatar
-    user.user_avatar.update_gravatar!
+    begin
+      user.refresh_avatar
+      user.user_avatar.update_gravatar!
+    rescue
+      # skip
+    end
     putc "." if (i += 1) % 10 == 0
   end

GitHub sha: a423e9b1

In general we usually don’t just eat exceptions I would recommend printing the error to STDERR at a minimum print X instead of . for an error.

2 Likes
1 Like