From 582aebaf0fc8561dbd74f43e2920003ec7af9c96 Mon Sep 17 00:00:00 2001 From: Collin R Date: Sun, 9 Feb 2020 22:20:29 -0800 Subject: [PATCH] Handle inability to establish connection --- pointsbot/bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pointsbot/bot.py b/pointsbot/bot.py index 9e0fd48..2621940 100644 --- a/pointsbot/bot.py +++ b/pointsbot/bot.py @@ -1,6 +1,7 @@ import re import praw +import prawcore from . import config, database, level, reply @@ -40,6 +41,8 @@ def run(): monitor_comments(subreddit, db) # Ignoring other potential exceptions for now, since we may not be able # to recover from them as well as from this one + except prawcore.exceptions.RequestException as e: + print('Unable to connect; attempting again....') except prawcore.exceptions.ServerError as e: print('Lost connection to Reddit; attempting to reconnect....')