google.takeout.paths: return Optional if there are no takeouts

This commit is contained in:
Dima Gerasimov 2020-10-11 22:16:39 +01:00 committed by karlicoss
parent 4666378f7e
commit e8e4994c02
6 changed files with 30 additions and 19 deletions

View file

@ -68,7 +68,10 @@ def _dal() -> dal.DAL:
@mcachew(config.cache_dir, hashf=lambda dal: dal.sources)
def events(dal=_dal()) -> Results:
for d in dal.events():
yield _parse_event(d)
if isinstance(d, Exception):
yield d
else:
yield _parse_event(d)
def stats():