lib/dumper/job.rb in dumper-1.3.3 vs lib/dumper/job.rb in dumper-1.3.4
- old
+ new
@@ -82,28 +82,29 @@
end
retry_count = 0
begin
response = http.request(request)
- rescue Errno::ECONNRESET
+ rescue # Errno::ECONNRESET, Errno::EPIPE, etc.
raise if retry_count > 3
retry_count += 1
log "upload failed: #{$!} - retrying..."
retry
end
log "response from S3 = #{response.to_s}"
response
rescue
- log_last_error
+ abort_with("upload error: #{$!}", :upload_error)
end
def abort_with(text, code=nil)
log text
@database.try(:finalize)
if code
@agent.api_request('backup/fail', :params => { :backup_id => @backup_id, :code => code.to_s, :message => text })
end
+ log 'aborting...'
exit!
end
end
end