mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
catch error on item.prepare in case of collection upload
This commit is contained in:
parent
2c0c0a7e50
commit
8837a61bce
1 changed files with 10 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import itertools
|
import itertools
|
||||||
|
import logging
|
||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
@ -89,7 +90,15 @@ def prepare(vobject_items: List[vobject.base.Component], path: str,
|
||||||
vobject_collection.add(vobject.base.ContentLine("PRODID", [], PRODID))
|
vobject_collection.add(vobject.base.ContentLine("PRODID", [], PRODID))
|
||||||
item = radicale_item.Item(collection_path=collection_path,
|
item = radicale_item.Item(collection_path=collection_path,
|
||||||
vobject_item=vobject_collection)
|
vobject_item=vobject_collection)
|
||||||
item.prepare()
|
logger.debug("Prepare item with UID '%s'", item.uid)
|
||||||
|
try:
|
||||||
|
item.prepare()
|
||||||
|
except ValueError as e:
|
||||||
|
if logger.isEnabledFor(logging.DEBUG):
|
||||||
|
logger.warning("Problem during prepare item with UID '%s' (content below): %s\n%s", item.uid, e, item._text)
|
||||||
|
else:
|
||||||
|
logger.warning("Problem during prepare item with UID '%s' (content suppressed in this loglevel): %s", item.uid, e)
|
||||||
|
raise
|
||||||
items.append(item)
|
items.append(item)
|
||||||
elif write_whole_collection and tag == "VADDRESSBOOK":
|
elif write_whole_collection and tag == "VADDRESSBOOK":
|
||||||
for vobject_item in vobject_items:
|
for vobject_item in vobject_items:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue