Skip to content

Commit

Permalink
エラーの起きない例外処理にする
Browse files Browse the repository at this point in the history
  • Loading branch information
yocchan-git committed Mar 9, 2024
1 parent 7b004a7 commit 3ee84fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,8 @@ def avatar_url
else
image_url default_image_path
end
rescue ActiveStorage::FileNotFoundError, ActiveStorage::InvariableError
rescue ActiveStorage::FileNotFoundError, ActiveStorage::InvariableError, Vips::Error
image_url default_image_path
rescue Vips::Error
avatar.variant(resize_to_fit: [120, 120]).processed.url
end

def generation
Expand Down

0 comments on commit 3ee84fd

Please sign in to comment.