From 6697b15413d31dc602e0220ea7970717b7f507ad Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Sun, 27 Oct 2019 14:24:21 -0700 Subject: [PATCH] More generously catch errors on userlookup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Okay so, userlookup stuff hasn't worked in years, because it requires a login now. But apparently, somewhere recently, the code inside our `neopets` gem started hard crashing, because of assumptions we made about the document we'd get back. I'm not sure why it only recently started crashing? or if I'm even necessarily right about that? But anyway, I'm just doing the easiest safest (🤞🏻) change possible: being more generous with the errors we swallow. Test Plan: Deploy and cross fingers. --- app/models/pet_state.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index e6dab9f4..beeea303 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -109,7 +109,7 @@ class PetState < ActiveRecord::Base self.female = user_pet.female? self.mood_id = user_pet.mood.id self.labeled = true - rescue Neopets::User::Error + rescue # If there's an error loading the userlookup data (e.g. account is # frozen), no big deal; we just won't label the pet right now. Proceed # as usual.