Skip to content

Commit

Permalink
Merge pull request #10504 from demarches-simplifiees/more-error-catch…
Browse files Browse the repository at this point in the history
…ing-in-gallery

Correctif (galerie) : catche les erreurs de type ActionViewTemplate
  • Loading branch information
E-L-T authored Jun 10, 2024
2 parents ab522a3 + 603bb97 commit bffca0c
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 bffca0c

Please sign in to comment.