[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a3d2bf2 2/2: Permit old XSL code to fail
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a3d2bf2 2/2: Permit old XSL code to fail |
Date: |
Wed, 31 Jan 2018 17:20:46 -0500 (EST) |
branch: master
commit a3d2bf28a71762379d07d7c916df55b6f002ad21
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Permit old XSL code to fail
Previously, if the old XSL code failed, the new PDF code wasn't run;
now it is. Motivation: FOP depends on 'java', but the 'java' version
that end users typically use can no longer be installed in a 'wine'
environment--and its installer is not free software, so we can't fix it.
---
ledger_pdf.cpp | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/ledger_pdf.cpp b/ledger_pdf.cpp
index beecd58..178c882 100644
--- a/ledger_pdf.cpp
+++ b/ledger_pdf.cpp
@@ -25,6 +25,7 @@
#include "configurable_settings.hpp"
#include "global_settings.hpp" // PDF !! expunge
+#include "handle_exceptions.hpp" // PDF !! expunge
#include "ledger.hpp"
#include "ledger_pdf_generator.hpp"
#include "ledger_xsl.hpp" // PDF !! expunge
@@ -37,9 +38,15 @@ std::string write_ledger_as_pdf(Ledger const& ledger,
fs::path const& filepath)
// PDF !! Expunge this conditional block:
if(global_settings::instance().ash_nazg())
{
- // Execute both the new and the old code so that their results
- // may be compared.
- write_ledger_as_pdf_via_xsl(ledger, filepath);
+ try
+ {
+ // Execute both the new and the old code so that their results
+ // may be compared.
+ write_ledger_as_pdf_via_xsl(ledger, filepath);
+ }
+ // Show any diagnostics, but swallow them so that any error in
+ // the old code doesn't prevent the new code from running.
+ catch(...) {report_exception();}
}
throw_if_interdicted(ledger);