From 3c16f84853cd8df7bc39b71f5225d17e428718f3 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Thu, 2 Apr 2015 00:34:44 +0200 Subject: [PATCH] even more output --- lib/common/db_updater.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/common/db_updater.rb b/lib/common/db_updater.rb index a3083e879..2f80ad158 100644 --- a/lib/common/db_updater.rb +++ b/lib/common/db_updater.rb @@ -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 @@ -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)