[view-column] refactor to remove reference to gnc:last-captured-error

because gnc:last-captured-error is a global var, and should be removed.
This commit is contained in:
Christopher Lam 2020-12-17 08:46:58 +08:00
parent 5f2a2f4626
commit a1cfdeb601

View File

@ -116,21 +116,17 @@
(gnc:report-set-stylesheet! (gnc:report-set-stylesheet!
subreport (gnc:report-stylesheet report)) subreport (gnc:report-stylesheet report))
;; render the report body ... hopefully this will DTRT ;; render the report body ... capture error if report crashes.
;; if there is an error, then dump a backtrace and print (gnc:html-table-cell-append-objects!
;; an error message contents-cell
;; and cache when it's ok to cache. (match (gnc:apply-with-error-handling
(if (not (gnc:backtrace-if-exception (lambda () (gnc:report-render-html subreport #f)) '())
(lambda () ((html #f) html)
(gnc:html-table-cell-append-objects! ((_ captured-error)
contents-cell (gnc:report-render-html subreport #f)) (gnc:make-html-text
#t))) (gnc:html-markup-h3 (G_ "Report error"))
(gnc:html-table-cell-append-objects! (G_ "An error occurred while running the report.")
contents-cell (gnc:html-markup "pre" captured-error)))))
(gnc:make-html-text
(gnc:html-markup-h3 (G_ "Report error"))
(G_ "An error occurred while running the report.")
(gnc:html-markup "pre" gnc:last-captured-error))))
;; increment the alloc number for each occupied row ;; increment the alloc number for each occupied row
(let loop ((row current-row-num)) (let loop ((row current-row-num))