This is an automated email from the ASF dual-hosted git repository.

rubys 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 ac6b728  provide more helpful information when template is busted
ac6b728 is described below

commit ac6b728123e866f660a673b50b0099c43beaccec
Author: Sam Ruby <[email protected]>
AuthorDate: Thu Jul 16 15:31:02 2020 -0400

    provide more helpful information when template is busted
---
 lib/whimsy/asf/board.rb    | 1 +
 www/board/agenda/routes.rb | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/board.rb b/lib/whimsy/asf/board.rb
index d4bc5c7..90625a2 100644
--- a/lib/whimsy/asf/board.rb
+++ b/lib/whimsy/asf/board.rb
@@ -124,6 +124,7 @@ module ASF
 
       def for(pmc)
         chair = pmc.chair
+        raise "no chair found for #{pmc.name}" if not chair
 
         if @directors.include? chair
           "#{chair.public_name}"
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index d507c3d..4b49b0e 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -547,7 +547,14 @@ get '/new' do
   template = File.join(ASF::SVN['foundation_board'], 'templates', 
'board_agenda.erb')
   @disabled = dir("board_agenda_*.txt").
     include? @meeting.strftime("board_agenda_%Y_%m_%d.txt")
-  @agenda = Erubis::Eruby.new(IO.read(template)).result(binding)
+
+  begin
+    @agenda = Erubis::Eruby.new(IO.read(template)).result(binding)
+  rescue => error
+    status 500
+    STDERR.puts error
+    return "error in #{template} in: #{error}"
+  end
 
   @cssmtime = File.mtime('public/stylesheets/app.css').to_i
   _html :new

Reply via email to