lib/dumper/job.rb in dumper-1.3.6 vs lib/dumper/job.rb in dumper-1.3.7

- old
+ new

@@ -91,11 +91,18 @@ log "upload failed: #{$!} - retrying after #{2 ** retry_count}sec..." sleep 2 ** retry_count retry end - log "response from S3 = #{response.to_s}" - response + log "response from S3 = #{response.to_s} - #{response.body}" + + # http://apidock.com/ruby/Net/HTTPResponse + case response + when Net::HTTPSuccess + true + else + abort_with("upload error: #{response.to_s} - #{response.body}", :upload_error) + end rescue abort_with("upload error: #{$!}", :upload_error) end def abort_with(text, code=nil)