From 533ebc587ee2b4e8e3c77b8ecd10056670483754 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Mon, 2 Jun 2014 22:28:39 +0200 Subject: Expanded ErrorCapacitor error message generation * added entity, line and column information * formatting analog to ErrorCapacitor warning messages ** i.e. this commit implements functionality similar to "xalanc::ProblemListenerBase::defaultFormat" for "xercesc::ErrorHandler" exceptions --- src/support/error_capacitor.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/support/error_capacitor.cc') diff --git a/src/support/error_capacitor.cc b/src/support/error_capacitor.cc index 1a536ed..e624cd1 100644 --- a/src/support/error_capacitor.cc +++ b/src/support/error_capacitor.cc @@ -11,9 +11,18 @@ namespace { +using InputXSLT::XercesStringGuard; + inline std::string getMessage(const xercesc::SAXParseException& exception) { - return std::string( - *InputXSLT::XercesStringGuard(exception.getMessage()) + return ( + std::string(*XercesStringGuard(exception.getMessage())) + + ". (Occurred in entity '" + + std::string(*XercesStringGuard(exception.getSystemId())) + + "', at line " + + std::to_string(exception.getLineNumber()) + + ", column " + + std::to_string(exception.getColumnNumber()) + + ".)" ); } -- cgit v1.2.3