Skip to content

Commit 5870a99

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 c54d7fd commit 5870a99

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
@@ -547,7 +547,7 @@ async def get_multi(self, hrefs):
547547
else:
548548
rv.append((href, Item(raw), etag))
549549
for href in hrefs_left:
550-
raise exceptions.NotFoundError(href)
550+
dav_logger.warning(f"Skipping {href}, not found")
551551

552552
for href, item, etag in rv:
553553
yield href, item, etag
@@ -645,6 +645,7 @@ def _parse_prop_responses(self, root, handled_hrefs=None):
645645
props = response.findall("{DAV:}propstat/{DAV:}prop")
646646
if props is None or not len(props):
647647
dav_logger.debug(f"Skipping {href!r}, properties are missing.")
648+
dav_logger.debug(f"Response for {href!r}: {etree.tostring(response)}")
648649
continue
649650
else:
650651
props = _merge_xml(props)

0 commit comments

Comments
 (0)