Skip to content

Commit 7a625da

Browse files
committed
Don't throw exceptions on unprocessed hrefs in get_multi
Rather, just log them. This allows my calendar sync to continue to work even if some of the hrefs can't be retrieved. In my case, one of the hrefs on my calendar was always returning a 404, so I want to skip it.
1 parent 3fe7dd7 commit 7a625da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vdirsyncer/storage/dav.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ async def get_multi(self, hrefs):
552552
else:
553553
rv.append((href, Item(raw), etag))
554554
for href in hrefs_left:
555-
raise exceptions.NotFoundError(href)
555+
dav_logger.warning(f"Skipping {href}, not found")
556556

557557
for href, item, etag in rv:
558558
yield href, item, etag
@@ -650,6 +650,7 @@ def _parse_prop_responses(self, root, handled_hrefs=None):
650650
props = response.findall("{DAV:}propstat/{DAV:}prop")
651651
if props is None or not len(props):
652652
dav_logger.debug(f"Skipping {href!r}, properties are missing.")
653+
dav_logger.debug(f"Response for {href!r}: {etree.tostring(response)}")
653654
continue
654655
else:
655656
props = _merge_xml(props)

0 commit comments

Comments
 (0)