Log XML on parse failure

pull/40/head
Visa Putkinen 2013-11-24 14:34:52 +02:00
parent 8b434dad14
commit 986ab4acc6
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include "Error.hh"
#include "Node.hh"
#include "util/log/Log.hh"
#include <expat.h>
@ -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 )