changeset 24926:ee9b00cc4298

Make XML parsing error levels match libxml2's levels, making less important errors less scary in the debug window
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 07 Jan 2009 01:18:16 +0000
parents 1300601041ac
children 6a1f8309c805 2aa4b88bdcf8
files libpurple/protocols/jabber/parser.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/parser.c	Wed Jan 07 01:15:36 2009 +0000
+++ b/libpurple/protocols/jabber/parser.c	Wed Jan 07 01:18:16 2009 +0000
@@ -234,12 +234,22 @@
 	} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
 		xmlError *err = xmlCtxtGetLastError(js->context);
 
-		purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret);
-
-		if (err->level == XML_ERR_FATAL) {
-			purple_connection_error_reason (js->gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("XML Parse error"));
+		switch (err->level) {
+			case XML_ERR_NONE:
+				purple_debug_info("jabber", "xmlParseChunk returned info %i\n", ret);
+				break;
+			case XML_ERR_WARNING:
+				purple_debug_warning("jabber", "xmlParseChunk returned warning %i\n", ret);
+				break;
+			case XML_ERR_ERROR:
+				purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret);
+				break;
+			case XML_ERR_FATAL:
+				purple_debug_error("jabber", "xmlParseChunk returned fatal %i\n", ret);
+				purple_connection_error_reason (js->gc,
+				                                PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+				                                _("XML Parse error"));
+				break;
 		}
 	}
 }