From fd211e7876d06813c778a556f1c24751f6758142 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 18 Oct 2012 12:06:21 -0400 Subject: [PATCH] rss2email: add specific SAXParseException error message. --- rss2email.py | 4 ++++ 1 file changed, 4 insertions(+) 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" -- 2.26.2