core: minor error handling tweaks

This commit is contained in:
Dima Gerasimov 2020-10-18 12:09:27 +01:00 committed by karlicoss
parent 2a2478bfa9
commit 831fee42a1
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(