Skip to content

Commit

Permalink
even more output
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed Apr 1, 2015
1 parent 346898e commit 3c16f84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/common/db_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def remote_file_checksum(filename)
url = "#{remote_file_url(filename)}.sha512"

res = Browser.get(url, request_params)
fail "Unable to get #{url} (return code #{res.code})" unless res.code == 200
additional_text = res.code == 0 ? res.return_message : "return code #{res.code}"
fail "Unable to get #{url} (#{additional_text})" unless res.code == 200
res.body
end

Expand Down Expand Up @@ -72,7 +73,8 @@ def download(filename)
file_url = remote_file_url(filename)

res = Browser.get(file_url, request_params)
fail "Error while downloading #{file_url} (return code #{res.code})" unless res.code == 200
additional_text = res.code == 0 ? res.return_message : "return code #{res.code}"
fail "Error while downloading #{file_url} (#{additional_text})" unless res.code == 200
File.open(file_path, 'wb') { |f| f.write(res.body) }

local_file_checksum(filename)
Expand Down

0 comments on commit 3c16f84

Please sign in to comment.