Skip to content

Commit

Permalink
Don't throw exceptions on unprocessed hrefs in get_multi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
telotortium committed Jun 8, 2022
1 parent 58cbcfb commit e94ac1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vdirsyncer/storage/dav.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e94ac1f

Please sign in to comment.