From db6ea52b44b2e6f2c03c818ffa94af93976f78c5 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 28 Feb 2014 01:18:21 +0100 Subject: Provide details about what error the XML parser encountered --- src/xmpp/xmpp_parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xmpp/xmpp_parser.cpp b/src/xmpp/xmpp_parser.cpp index 9fcc16c..064453e 100644 --- a/src/xmpp/xmpp_parser.cpp +++ b/src/xmpp/xmpp_parser.cpp @@ -51,7 +51,8 @@ int XmppParser::feed(const char* data, const int len, const bool is_final) { int res = XML_Parse(this->parser, data, len, is_final); if (res == 0) - log_error("Xml_Parse encountered an error"); + log_error("Xml_Parse encountered an error: " << + XML_ErrorString(XML_GetErrorCode(this->parser))) return res; } @@ -59,7 +60,8 @@ int XmppParser::parse(const int len, const bool is_final) { int res = XML_ParseBuffer(this->parser, len, is_final); if (res == 0) - log_error("Xml_Parsebuffer encountered an error"); + log_error("Xml_Parsebuffer encountered an error: " << + XML_ErrorString(XML_GetErrorCode(this->parser))); return res; } -- cgit v1.2.3