Don't dump exception logs for XML stream parsing errors.

The exceptions are handled, so we don't need to clutter the output logs.
This commit is contained in:
Lance Stout 2012-01-12 22:26:15 -08:00
parent e8b2dd6698
commit 1ae219025a

View file

@ -763,6 +763,11 @@ class BaseXMPP(XMLStream):
iq = exception.iq iq = exception.iq
log.error('Request timed out: %s', iq) log.error('Request timed out: %s', iq)
log.warning('You should catch IqTimeout exceptions') 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: else:
log.exception(exception) log.exception(exception)