From 1ae219025a3f3369a76dfd9c2ab3fea6c05bfccc Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Thu, 12 Jan 2012 22:26:15 -0800 Subject: [PATCH] Don't dump exception logs for XML stream parsing errors. The exceptions are handled, so we don't need to clutter the output logs. --- sleekxmpp/basexmpp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 11e787ad..e4fd03a1 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -763,6 +763,11 @@ class BaseXMPP(XMLStream): iq = exception.iq log.error('Request timed out: %s', iq) log.warning('You should catch IqTimeout exceptions') + elif isinstance(exception, SyntaxError): + # Hide stream parsing errors that occur when the + # stream is disconnected (they've been handled, we + # don't need to make a mess in the logs). + pass else: log.exception(exception)