Skip to content

Commit

Permalink
fix(gallery): catch StandardError
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Jun 10, 2024
1 parent fe0619a commit a59f1ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/gallery_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ def displayable_image?(blob)

def preview_url_for(attachment)
attachment.preview(resize_to_limit: [400, 400]).processed.url
rescue ActiveStorage::Error
rescue StandardError
'pdf-placeholder.png'
end

def variant_url_for(attachment)
attachment.variant(resize_to_limit: [400, 400]).processed.url
rescue ActiveStorage::Error
rescue StandardError
'apercu-indisponible.png'
end

def blob_url(attachment)
attachment.blob.content_type.in?(RARE_IMAGE_TYPES) ? attachment.variant(resize_to_limit: [2000, 2000]).processed.url : attachment.blob.url
rescue ActiveStorage::Error
rescue StandardError
attachment.blob.url
end
end

0 comments on commit a59f1ca

Please sign in to comment.