From: W. Trevor King Date: Thu, 18 Oct 2012 16:06:21 +0000 (-0400) Subject: rss2email: add specific SAXParseException error message. X-Git-Tag: v3.0~72^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fd211e7876d06813c778a556f1c24751f6758142;p=rss2email.git rss2email: add specific SAXParseException error message. --- diff --git a/rss2email.py b/rss2email.py index 5463d48..886fea5 100755 --- a/rss2email.py +++ b/rss2email.py @@ -44,6 +44,7 @@ import types as _types import urllib.request as _urllib_request import urllib.error as _urllib_error import xml.dom.minidom as _minidom +import xml.sax as _sax import xml.sax.saxutils as _saxutils UNIX = False @@ -868,6 +869,9 @@ class Feed (object): warned = True elif isinstance(exc, KeyboardInterrupt): raise exc + elif isinstance(exc, _sax.SAXParseException): + LOG.error('sax parsing error: {}: {}'.format(exc, self)) + warned = True elif parsed.bozo or exc: if exc is None: exc = "can't process"