AUDIT: r17178 - gnucash/trunk/src/report/report-system - Reporting: Prevent GnuCash from crashing if a report's option generating procedure causes a Scheme exception. Also fix a typo of "names" vs. "namer".

Charles Day cedayiv at cvs.gnucash.org
Wed May 28 11:47:49 EDT 2008


Author: cedayiv
Date: 2008-05-28 11:47:49 -0400 (Wed, 28 May 2008)
New Revision: 17178
Trac: http://svn.gnucash.org/trac/changeset/17178

Modified:
   gnucash/trunk/src/report/report-system/report.scm
Log:
Reporting: Prevent GnuCash from crashing if a report's option generating procedure causes a Scheme exception. Also fix a typo of "names" vs. "namer".
BP


Modified: gnucash/trunk/src/report/report-system/report.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report.scm	2008-05-27 22:53:49 UTC (rev 17177)
+++ gnucash/trunk/src/report/report-system/report.scm	2008-05-28 15:47:49 UTC (rev 17178)
@@ -1,5 +1,5 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; report.scm : structures/utilities for representing reports 
+;; rport.scm : structures/utilities for representing reports 
 ;; Copyright 2000 Bill Gribble <grib at gnumatic.com>
 ;;
 ;; This program is free software; you can redistribute it and/or    
@@ -253,13 +253,19 @@
            (gnc:get-html-style-sheets)))))
 
     (if (procedure? generator)
-        (let ((options (generator)))
+        (let ((options (gnc:backtrace-if-exception generator)))
+          (if (not options)
+              (begin
+                (gnc:warn "BUG DETECTED: Scheme exception raised in "
+                          "report options generator procedure named "
+                          (procedure-name generator))
+                (set! options (gnc:new-options))))
           (gnc:register-option options stylesheet)
           (gnc:register-option options namer)
           options)
         (let ((options (gnc:new-options)))
           (gnc:register-option options stylesheet)
-          (gnc:register-option options names)
+          (gnc:register-option options namer)
           options))))
 
 ;; A <report> represents an instantiation of a particular report type.



More information about the gnucash-changes mailing list