You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/06/25 23:04:17 UTC

[whimsy] branch master updated: Reverse check for error

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 9390a04  Reverse check for error
9390a04 is described below

commit 9390a04b084ea940c02d07ab3f0e20d45ec4bbe6
Author: Sebb <se...@apache.org>
AuthorDate: Fri Jun 26 00:04:07 2020 +0100

    Reverse check for error
---
 www/officers/coi.cgi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/officers/coi.cgi b/www/officers/coi.cgi
index 9bd3152..af71dc3 100755
--- a/www/officers/coi.cgi
+++ b/www/officers/coi.cgi
@@ -68,7 +68,8 @@ def get_affirmed_template(user, password, name, timestamp)
        Metadata: _______________Whimsy www/officers/coi.cgi________________'
   template, err =
     ASF::SVN.svn('cat', COI_CURRENT_TEMPLATE_URL, {user: $USER, password: $PASSWORD})
-  raise RuntimeError.new("Failed to read current template.txt -- %s" % err) if err
+  # Need to check output for nil rather than err as err may contain text even on success
+  raise RuntimeError.new("Failed to read current template.txt -- %s" % err) unless template
   centered_name = "#{name}".center(60, '_')
   centered_date ="#{timestamp}".center(61, '_')
   filled_signature_block = signature_block