From 387f68acc9df29bfb94a0ec690389c361d711e08 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 3 Feb 2022 10:39:52 +0000 Subject: [PATCH] Standardize exception message prefix --- desktop_client.py | 2 +- newsdaemon.py | 4 ++-- newswire.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop_client.py b/desktop_client.py index e502b71dd..e6752427a 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -176,7 +176,7 @@ def _mark_post_as_read(actor: str, post_id: str, post_category: str) -> None: read_file.seek(0, 0) read_file.write(post_id + content) except Exception as ex: - print('WARN: Failed to mark post as read' + str(ex)) + print('EX: Failed to mark post as read' + str(ex)) else: with open(read_posts_filename, 'w+') as read_file: read_file.write(post_id + '\n') diff --git a/newsdaemon.py b/newsdaemon.py index 4532549c1..3cca873a5 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -54,8 +54,8 @@ def _update_feeds_outbox_index(base_dir: str, domain: str, feeds_file.seek(0, 0) feeds_file.write(post_id + '\n' + content) print('DEBUG: feeds post added to index') - except Exception as ex: - print('WARN: Failed to write entry to feeds posts index ' + + except BaseException as ex: + print('EX: Failed to write entry to feeds posts index ' + index_filename + ' ' + str(ex)) else: try: diff --git a/newswire.py b/newswire.py index e5d72ebe7..1bdec5807 100644 --- a/newswire.py +++ b/newswire.py @@ -1213,7 +1213,7 @@ def get_rs_sfrom_dict(base_dir: str, newswire: {}, published = published_with_offset.strftime("%Y-%m-%dT%H:%M:%SZ") try: pub_date = datetime.strptime(published, "%Y-%m-%dT%H:%M:%SZ") - except Exception as ex: + except BaseException as ex: print('WARN: Unable to convert date ' + published + ' ' + str(ex)) continue rss_str += \