diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 9af23e4068..7c88411c05 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -1,7 +1,5 @@ # frozen_string_literal: false -require "mini_magick" - class Enterprise < ApplicationRecord SELLS = %w(unspecified none own any).freeze ENTERPRISE_SEARCH_RADIUS = 100 @@ -479,7 +477,7 @@ class Enterprise < ApplicationRecord return unless image.variable? image_variant_url_for(image.variant(name)) - rescue ActiveStorage::Error, MiniMagick::Error, ActionView::Template::Error => e + rescue StandardError => e Bugsnag.notify "Enterprise ##{id} #{image.try(:name)} error: #{e.message}" Rails.logger.error(e.message) diff --git a/app/models/spree/image.rb b/app/models/spree/image.rb index 77a463c301..45859a6b45 100644 --- a/app/models/spree/image.rb +++ b/app/models/spree/image.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "mini_magick" - module Spree class Image < Asset has_one_attached :attachment, service: image_service do |attachment| @@ -35,7 +33,7 @@ module Spree return self.class.default_image_url(size) unless attachment.attached? image_variant_url_for(variant(size)) - rescue ActiveStorage::Error, MiniMagick::Error, ActionView::Template::Error => e + rescue StandardError => e Bugsnag.notify "Product ##{viewable_id} Image ##{id} error: #{e.message}" Rails.logger.error(e.message)