Skip to content

Commit

Permalink
Checking for feed parser errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dplocki committed Mar 21, 2024
1 parent c0419b3 commit fa967eb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions podcast_downloader/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,14 @@ def configuration_to_function_rss_to_name(
logger.info('Skipping the "%s"', rss_source_name)
continue

try:
feed = load_feed(rss_source_link)
if not rss_source_name:
rss_source_name = get_feed_title_from_feed(feed)

except error:
logger.error(f"Error while checking the link: '{rss_source_link}': {error}")
feed = load_feed(rss_source_link)
if feed.bozo:
logger.error(f"Error while checking the link: '{rss_source_link}': {feed['bozo_exception'].reason.strerror}")
continue

if not rss_source_name:
rss_source_name = get_feed_title_from_feed(feed)

logger.info('Checking "%s"', rss_source_name)

to_name_function = configuration_to_function_rss_to_name(
Expand Down

0 comments on commit fa967eb

Please sign in to comment.