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.
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 @@
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 @@
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)