Commit 6596360a by Hayden Ball Committed by Sid Raval

Include Cocaine error when there was an error processing thumbnails (#2415)

parent d7251af8
...@@ -85,7 +85,10 @@ module Paperclip ...@@ -85,7 +85,10 @@ module Paperclip
dest: File.expand_path(dst.path), dest: File.expand_path(dst.path),
) )
rescue Terrapin::ExitStatusError => e rescue Terrapin::ExitStatusError => e
raise Paperclip::Error, "There was an error processing the thumbnail for #{@basename}" if @whiny if @whiny
message = "There was an error processing the thumbnail for #{@basename}:\n" + e.message
raise Paperclip::Error, message
end
rescue Terrapin::CommandNotFoundError => e rescue Terrapin::CommandNotFoundError => e
raise Paperclip::Errors::CommandNotFoundError.new("Could not run the `convert` command. Please install ImageMagick.") raise Paperclip::Errors::CommandNotFoundError.new("Could not run the `convert` command. Please install ImageMagick.")
end end
......
...@@ -179,10 +179,12 @@ describe Paperclip::Thumbnail do ...@@ -179,10 +179,12 @@ describe Paperclip::Thumbnail do
end end
it "errors when trying to create the thumbnail" do it "errors when trying to create the thumbnail" do
assert_raises(Paperclip::Error) do
silence_stream(STDERR) do silence_stream(STDERR) do
expect {
@thumb.make @thumb.make
end }.to raise_error(
Paperclip::Error, /unrecognized option `-this-aint-no-option'/
)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment