whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch pip3-img2pdf updated: fix default time for next meeting:
Date Fri, 21 Dec 2018 19:39:16 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch pip3-img2pdf
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/pip3-img2pdf by this push:
     new f27e245  fix default time for next meeting:
f27e245 is described below

commit f27e24516dfdd9174ab2752be0ac3522f1edf8b7
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Fri Dec 21 14:37:09 2018 -0500

    fix default time for next meeting:
    
     * correctly handle the case where the 3rd Wednesday of this month has
       already passed.
     * display raw stack traceback in the case where a properly formatted
       JSON exception is not provided.
---
 lib/whimsy/asf/board.rb            | 6 +++++-
 www/board/agenda/views/utils.js.rb | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/board.rb b/lib/whimsy/asf/board.rb
index 7034ab4..dc6ec85 100644
--- a/lib/whimsy/asf/board.rb
+++ b/lib/whimsy/asf/board.rb
@@ -27,8 +27,12 @@ module ASF
 
       if not time
         require 'chronic'
+
         time ||= Chronic.parse('3rd wednesday this month')
-        time = Chronic.parse('3rd wednesday next month') if time < Time.now.utc
+
+        if not time or time < Time.now.utc
+          time = Chronic.parse('3rd wednesday next month')
+        end
       end
 
       time
diff --git a/www/board/agenda/views/utils.js.rb b/www/board/agenda/views/utils.js.rb
index 4085c20..7bead82 100644
--- a/www/board/agenda/views/utils.js.rb
+++ b/www/board/agenda/views/utils.js.rb
@@ -104,7 +104,11 @@ def retrieve(target, type, &block)
           elsif xhr.response.exception
             message = "Exception\n#{xhr.response.exception}"
           else
-            message = "Exception\n#{JSON.parse(xhr.responseText).exception}"
+            begin
+              message = "Exception\n#{JSON.parse(xhr.responseText).exception}"
+            rescue => e
+              message = "Exception\n#{xhr.responseText}"
+            end
           end
 
           console.log(message)


Mime
View raw message