Add exception handling to koji rss feed
This commit is contained in:
		| @@ -110,8 +110,14 @@ def send_startup_message(): | ||||
|  | ||||
| # Function to fetch and parse the Koji RSS feed | ||||
| def fetch_koji_feed(): | ||||
|     feed = feedparser.parse(KOJI_RSS_URL) | ||||
|     return feed.entries | ||||
|     try: | ||||
|         feed = feedparser.parse(KOJI_RSS_URL) | ||||
|         return feed.entries | ||||
|     except Exception as e: | ||||
|         exc_type, exc_value, exc_traceback = sys.exc_info() | ||||
|         logging.error(f"RSS request to koji failed: {exc_type.__name__}: {str(e)}") | ||||
|         logging.debug(f"Exception traceback: {''.join(traceback.format_tb(exc_traceback))}") | ||||
|         return [] | ||||
|  | ||||
| # Main polling loop | ||||
| def main(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user