Skip to content

Commit

Permalink
Merge branch '919_more_sensible_download_error_message' of git://gith…
Browse files Browse the repository at this point in the history
…ub.com/rezwyi/carrierwave
  • Loading branch information
bensie committed Jan 6, 2013
2 parents 21cea48 + fcbbfb3 commit d86a74b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/carrierwave/uploader/download.rb
Expand Up @@ -37,8 +37,8 @@ def file
end
@file

rescue
raise CarrierWave::DownloadError, "could not download file"
rescue Exception => e
raise CarrierWave::DownloadError, "could not download file cause: #{e.message}"
end

def method_missing(*args, &block)
Expand Down
6 changes: 6 additions & 0 deletions spec/uploader/download_spec.rb
Expand Up @@ -102,6 +102,12 @@
@uploader.url.should == '/uploads/tmp/20071201-1234-345-2255/test.jpg'
end

it 'should not obscure original exception message' do
expect {
@uploader.download!('http://www.example.com/missing.jpg')
}.to raise_error(CarrierWave::DownloadError, 'could not download file cause: 404 ')
end

describe '#download! with an extension_white_list' do
before do
@uploader_class.class_eval do
Expand Down

0 comments on commit d86a74b

Please sign in to comment.