core: minor error handling tweaks

This commit is contained in:
Dima Gerasimov 2020-10-18 12:09:27 +01:00
parent 7271a42972
commit 24b2e26c96
3 changed files with 13 additions and 8 deletions

View file

@ -34,11 +34,11 @@ def to_note(x: Org) -> OrgNote:
try:
# TODO(porg) not sure if created should ever throw... maybe warning/log?
c = x.created
if c is not None and isinstance(c, date):
if isinstance(c, datetime):
created = c
else:
# meh. not sure if should return date...
created = None
else:
created = c
except Exception as e:
created = None
return OrgNote(