fix(gallery): catch StandardError
This commit is contained in:
parent
ab522a3e40
commit
603bb97679
1 changed files with 3 additions and 3 deletions
|
@ -9,19 +9,19 @@ module GalleryHelper
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue