[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9b14f6f 1/2: Permit old XSL code to fail more
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9b14f6f 1/2: Permit old XSL code to fail more gracefully |
Date: |
Fri, 2 Feb 2018 07:32:31 -0500 (EST) |
branch: master
commit 9b14f6fbf20f90011ef38d5565e1ba02165986ac
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Permit old XSL code to fail more gracefully
Previously, diagnostics arising from the old XSL code were shown in
obtrusive messageboxes; now, when the developer-only password is
given, they're shown on the console instead. Demoting nuisances due
to 'java' makes it possible to run the automated GUI test cleanly.
---
ledger_pdf.cpp | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/ledger_pdf.cpp b/ledger_pdf.cpp
index 178c882..ec90ad3 100644
--- a/ledger_pdf.cpp
+++ b/ledger_pdf.cpp
@@ -25,12 +25,13 @@
#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
#include "path_utility.hpp" // unique_filepath()
+#include <iostream> // cerr // PDF !! expunge
+
/// Write ledger as pdf.
std::string write_ledger_as_pdf(Ledger const& ledger, fs::path const& filepath)
@@ -44,9 +45,18 @@ std::string write_ledger_as_pdf(Ledger const& ledger,
fs::path const& filepath)
// 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();}
+ // The developer-only password having been specified, show
+ // diagnostics only on the console, and don't let them escape
+ // (so that any error in the old code doesn't prevent the new
+ // code from running).
+ catch(std::exception const& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
+ catch(...)
+ {
+ throw;
+ }
}
throw_if_interdicted(ledger);