Log exceptions

This commit is contained in:
nemunaire 2023-01-16 13:48:41 +01:00
commit 287c4ac349
3 changed files with 13 additions and 14 deletions

View file

@ -2,6 +2,7 @@ from collections.abc import Iterable
from datetime import date, datetime, timedelta, timezone
from functools import reduce
import hashlib
import logging
import re
import time
import urllib.error
@ -47,11 +48,9 @@ class IcalModule:
with open(cache_file, 'wb') as fd:
fd.write(c.read())
except ConnectionResetError as e:
print(e)
pass
logging.exception(e)
except urllib.error.URLError as e:
print(e)
pass
logging.exception(e)
with open(cache_file) as c:
ecal = Calendar.from_ical(c.read())