Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Include Cocaine error when there was an error processing thumbnails (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ball-hayden authored and sidraval committed May 7, 2018
1 parent d7251af commit 6596360
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/paperclip/thumbnail.rb
Expand Up @@ -85,7 +85,10 @@ def make
dest: File.expand_path(dst.path),
)
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
raise Paperclip::Errors::CommandNotFoundError.new("Could not run the `convert` command. Please install ImageMagick.")
end
Expand Down
8 changes: 5 additions & 3 deletions spec/paperclip/thumbnail_spec.rb
Expand Up @@ -179,10 +179,12 @@
end

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
end
}.to raise_error(
Paperclip::Error, /unrecognized option `-this-aint-no-option'/
)
end
end

Expand Down

0 comments on commit 6596360

Please sign in to comment.