From 58c0cd898311a20b317c8a21efaf80c5272d7578 Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Sat, 16 Nov 2024 21:11:49 -0600 Subject: [PATCH] catch HTTPError when updating discord avatar --- app/models/api_user.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/api_user.rb b/app/models/api_user.rb index e10f4c5..6a03868 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -77,6 +77,8 @@ class APIUser < ApplicationRecord avatar.attach(io: image, filename: "#{hash}.webp") update!(last_avatar_hash: hash) true + rescue OpenURI::HTTPError => e + Rails.logger.warn(e) end def can_create_apikey?