From 986ab4acc6f0274d8d2cf54e52e80e0ce775ddee Mon Sep 17 00:00:00 2001 From: Visa Putkinen Date: Sun, 24 Nov 2013 14:34:52 +0200 Subject: [PATCH] Log XML on parse failure --- libgrive/src/xml/TreeBuilder.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgrive/src/xml/TreeBuilder.cc b/libgrive/src/xml/TreeBuilder.cc index c1ad385..9d57501 100644 --- a/libgrive/src/xml/TreeBuilder.cc +++ b/libgrive/src/xml/TreeBuilder.cc @@ -21,6 +21,7 @@ #include "Error.hh" #include "Node.hh" +#include "util/log/Log.hh" #include @@ -72,8 +73,10 @@ void TreeBuilder::ParseData( const char *data, std::size_t count, bool last ) { is_new = false ; - if ( ::XML_Parse( m_impl->psr, data, count, last ) == 0 ) + if ( ::XML_Parse( m_impl->psr, data, count, last ) == 0 ) { + Log("Error parsing XML: %1%", data, log::error); BOOST_THROW_EXCEPTION( Error() << ExpatApiError("XML_Parse") ); + } } Node TreeBuilder::Parse( const std::string& xml )