Skip to content

Commit 6139d6d

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 8044106 commit 6139d6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vdirsyncer/storage/dav.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ async def get_multi(self, hrefs):
553553
else:
554554
rv.append((href, Item(raw), etag))
555555
for href in hrefs_left:
556-
raise exceptions.NotFoundError(href)
556+
dav_logger.warning(f"Skipping {href}, not found")
557557

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

0 commit comments

Comments
 (0)