From 603bb97679ec8e9f9a33eacb014062b6fbe1238c Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Mon, 10 Jun 2024 11:29:50 +0200 Subject: [PATCH] fix(gallery): catch StandardError --- app/helpers/gallery_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/gallery_helper.rb b/app/helpers/gallery_helper.rb index 98f7ffc1e..1f9ddeeab 100644 --- a/app/helpers/gallery_helper.rb +++ b/app/helpers/gallery_helper.rb @@ -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