From 50f61d792c9ee7382be55c59af59511038274ec9 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 27 Nov 2020 15:41:08 -0800 Subject: [PATCH] Print 404 error separately from general stacktrace. --- timesearch_modules/livestream.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/timesearch_modules/livestream.py b/timesearch_modules/livestream.py index 992a2a0..fd0cc8d 100644 --- a/timesearch_modules/livestream.py +++ b/timesearch_modules/livestream.py @@ -1,4 +1,5 @@ import copy +import prawcore import time import traceback @@ -152,6 +153,10 @@ def _livestream_as_a_generator( ) newitems = database.insert(items) yield newitems + except prawcore.exceptions.NotFound: + print(database.filepath.basename, '404 not found') + step = {'tsdb': database, 'new_comments': 0, 'new_submissions': 0} + yield step except Exception: traceback.print_exc() print('Retrying...')