From e94ac1f3375191758bc7fc6b3ee7fab4408ac9b8 Mon Sep 17 00:00:00 2001 From: "robert.irelan" Date: Mon, 28 Mar 2022 13:24:41 -0700 Subject: [PATCH] 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. --- vdirsyncer/storage/dav.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 5b3220df..9620be99 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -547,7 +547,7 @@ async def get_multi(self, hrefs): else: rv.append((href, Item(raw), etag)) for href in hrefs_left: - raise exceptions.NotFoundError(href) + dav_logger.warning(f"Skipping {href}, not found") for href, item, etag in rv: yield href, item, etag @@ -645,6 +645,7 @@ def _parse_prop_responses(self, root, handled_hrefs=None): props = response.findall("{DAV:}propstat/{DAV:}prop") if props is None or not len(props): dav_logger.debug(f"Skipping {href!r}, properties are missing.") + dav_logger.debug(f"Response for {href!r}: {etree.tostring(response)}") continue else: props = _merge_xml(props)