mirror of
https://github.com/sjlongland/tornado-news.git
synced 2025-09-13 10:03:14 +10:00
On error, dump the feed we tried to parse
Try to give more diagnostic information when a feed fails to be parsed. This can be used to troubleshoot code later.
This commit is contained in:
parent
d1acc132d2
commit
08221046a5
@ -302,8 +302,13 @@ class FeedFetcher(object):
|
||||
parsed = feedparser.parse(body)
|
||||
|
||||
# Extract the entries from the feed
|
||||
entries = list(map(partial(FeedEntry.from_entry, name),
|
||||
parsed['entries']))
|
||||
try:
|
||||
entries = list(map(partial(FeedEntry.from_entry, name),
|
||||
parsed['entries']))
|
||||
except:
|
||||
self._log.error('Unhandled exception parsing entries:\n%s',
|
||||
yaml.dump(parsed, default_flow_style=False))
|
||||
raise
|
||||
|
||||
if not cached and (cache_dir is not None):
|
||||
cache_out = yaml.safe_dump([e.raw for e in entries])
|
||||
|
Loading…
Reference in New Issue
Block a user