catch HTTPError when updating discord avatar

This commit is contained in:
Donovan Daniels 2024-11-16 21:11:49 -06:00
parent 41177bc37a
commit 58c0cd8983
No known key found for this signature in database
GPG Key ID: 743DAAE6359EDBA1

View File

@ -77,6 +77,8 @@ class APIUser < ApplicationRecord
avatar.attach(io: image, filename: "#{hash}.webp") avatar.attach(io: image, filename: "#{hash}.webp")
update!(last_avatar_hash: hash) update!(last_avatar_hash: hash)
true true
rescue OpenURI::HTTPError => e
Rails.logger.warn(e)
end end
def can_create_apikey? def can_create_apikey?