Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actual IM error to output when failing to process #2733

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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