strings when they're written to the output file (reported by Cristian
Rigamonti).
+Add the "showtracebacks" option, which causes exceptions that occur
+while a feed is being fetched to be reported with a traceback in the
+resulting error message.
+
- rawdog 2.12
Make rawdog work with Python 2.6 (reported by Roy Lanek).
# errors; if this is true, rawdog will silently ignore them.
ignoretimeouts false
+# Whether to show Python traceback messages. If this is true, rawdog will show
+# a traceback message if an exception is thrown while fetching a feed; this is
+# mostly useful for debugging rawdog or feedparser.
+showtracebacks false
+
# Whether to display verbose status messages saying what rawdog's doing
# while it runs. Specifying -v or --verbose on the command line is
# equivalent to saying "verbose true" here.
handlers = handlers,
auth_creds = auth_creds,
use_im = use_im)
- except:
- return None
+ except Exception, e:
+ return {
+ "rawdog_exception": e,
+ "rawdog_traceback": sys.exc_info()[2],
+ }
def update(self, rawdog, now, config, articles, p):
"""Add new articles from a feed to the collection.
Returns True if any articles were read, False otherwise."""
- status = None
- if p is not None:
- status = p.get("status")
+ status = p.get("status")
self.last_update = now
error = None
non_fatal = False
old_url = self.url
- if p is None:
- error = "Error fetching or parsing feed."
+ if "rawdog_exception" in p:
+ error = "Error fetching or parsing feed: %s" % str(p["rawdog_exception"])
+ if config["showtracebacks"]:
+ from traceback import format_tb
+ error += "\n" + "".join(format_tb(p["rawdog_traceback"]))
elif status is None and len(p["feed"]) == 0:
if config["ignoretimeouts"]:
return False
"itemtemplate" : "default",
"verbose" : 0,
"ignoretimeouts" : 0,
+ "showtracebacks" : 0,
"daysections" : 1,
"timesections" : 1,
"blocklevelhtml" : 1,
self["verbose"] = parse_bool(l[1])
elif l[0] == "ignoretimeouts":
self["ignoretimeouts"] = parse_bool(l[1])
+ elif l[0] == "showtracebacks":
+ self["showtracebacks"] = parse_bool(l[1])
elif l[0] == "daysections":
self["daysections"] = parse_bool(l[1])
elif l[0] == "timesections":