whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Report fetch error better
Date Sun, 28 Jun 2020 23:57:36 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 8284e22  Report fetch error better
8284e22 is described below

commit 8284e221055c1a5f31f2bf33c7860d2a2588b46f
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jun 29 00:57:28 2020 +0100

    Report fetch error better
---
 www/board/agenda/models/reporter.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/www/board/agenda/models/reporter.rb b/www/board/agenda/models/reporter.rb
index b2af4ee..0faa7cf 100644
--- a/www/board/agenda/models/reporter.rb
+++ b/www/board/agenda/models/reporter.rb
@@ -45,7 +45,11 @@ class Reporter
         request = Net::HTTP::Get.new(uri)
         request.basic_auth env.user, env.password
         response = http.request(request)
-        report_status.merge! JSON.parse(response.body)['report_status']
+        if response.code == "200"
+          report_status.merge! JSON.parse(response.body)['report_status']
+        else
+          Wunderbar.error "Failed to fetch #{uri}: #{response.code}"
+        end
 
         if not File.exist? cache or JSON.parse(File.read cache) != report_status
           changed = true


Mime
View raw message