mirror of https://gitlab.com/bashrc2/epicyon
Add exception handling
parent
9d7170dc93
commit
966ec3389f
|
@ -189,10 +189,14 @@ 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 OSError as ex:
|
||||
print('EX: Failed to mark post as read' + str(ex))
|
||||
else:
|
||||
with open(read_posts_filename, 'w+', encoding='utf-8') as read_file:
|
||||
read_file.write(post_id + '\n')
|
||||
print('EX: Failed to mark post as read 1 ' + str(ex))
|
||||
else
|
||||
try::
|
||||
with open(read_posts_filename, 'w+',
|
||||
encoding='utf-8') as read_file:
|
||||
read_file.write(post_id + '\n')
|
||||
except OSError as ex:
|
||||
print('EX: Failed to mark post as read 2 ' + str(ex))
|
||||
|
||||
|
||||
def _has_read_post(actor: str, post_id: str, post_category: str) -> bool:
|
||||
|
|
Loading…
Reference in New Issue