mirror of
https://github.com/Kozea/Radicale.git
synced 2025-09-15 20:36:55 +00:00
add option to skip broken item instead of triggering exception
This commit is contained in:
parent
518de6b360
commit
fc7b50d69f
5 changed files with 19 additions and 1 deletions
|
@ -101,7 +101,11 @@ class CollectionPartGet(CollectionPartCache, CollectionPartLock,
|
|||
cache_content = self._store_item_cache(
|
||||
href, temp_item, cache_hash)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Failed to load item %r in %r: %s" %
|
||||
if self._skip_broken_item:
|
||||
logger.warning("Skip broken item %r in %r: %s", href, self.path, e)
|
||||
return
|
||||
else:
|
||||
raise RuntimeError("Failed to load item %r in %r: %s" %
|
||||
(href, self.path, e)) from e
|
||||
# Clean cache entries once after the data in the file
|
||||
# system was edited externally.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue