Skip to content

Commit

Permalink
Add actual IM error to output when failing to process
Browse files Browse the repository at this point in the history
  • Loading branch information
gblair committed Mar 21, 2024
1 parent 5316b35 commit b36b408
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/carrierwave/processing/mini_magick.rb
Expand Up @@ -266,7 +266,7 @@ def manipulate!
rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
raise e if e.message =~ /(You must have .+ installed|is not installed|executable not found)/
message = I18n.translate(:"errors.messages.processing_error")
raise CarrierWave::ProcessingError, message
raise CarrierWave::ProcessingError, "#{message}: #{e.message}"
ensure
image.destroy! if image
end
Expand Down Expand Up @@ -313,7 +313,7 @@ def minimagick!(block = nil)
rescue ::MiniMagick::Error, ::MiniMagick::Invalid => e
raise e if e.message =~ /(You must have .+ installed|is not installed|executable not found)/
message = I18n.translate(:"errors.messages.processing_error")
raise CarrierWave::ProcessingError, message
raise CarrierWave::ProcessingError, "#{message}: #{e.message}"
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/carrierwave/processing/rmagick.rb
Expand Up @@ -366,8 +366,8 @@ def manipulate!(options={}, &block)
end

destroy_image(frames)
rescue ::Magick::ImageMagickError
raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.processing_error")
rescue ::Magick::ImageMagickError => e
raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.processing_error") + ": #{e.message}"
end

private
Expand Down

0 comments on commit b36b408

Please sign in to comment.