diff --git a/lib/paperclip/thumbnail.rb b/lib/paperclip/thumbnail.rb index fee246a93..8a3af14d3 100644 --- a/lib/paperclip/thumbnail.rb +++ b/lib/paperclip/thumbnail.rb @@ -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 diff --git a/spec/paperclip/thumbnail_spec.rb b/spec/paperclip/thumbnail_spec.rb index 03c8c1e08..aa42b993e 100644 --- a/spec/paperclip/thumbnail_spec.rb +++ b/spec/paperclip/thumbnail_spec.rb @@ -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