From da612cfccb57c3e4b5677c88f817dc02148ed723 Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Mon, 1 Dec 2025 18:51:41 +0100 Subject: [PATCH] add broken vaddressbook logging similar to vcalendar --- radicale/app/put.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/radicale/app/put.py b/radicale/app/put.py index 0a72d00a..daec6339 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -108,7 +108,19 @@ def prepare(vobject_items: List[vobject.base.Component], path: str, for vobject_item in vobject_items: item = radicale_item.Item(collection_path=collection_path, vobject_item=vobject_item) - item.prepare() + logger.debug("Prepare item with UID '%s'", item.uid) + try: + item.prepare() + except (RuntimeError, ValueError, AttributeError) as e: + if logger.isEnabledFor(logging.DEBUG): + if item._text is None: + content = vobject_item + else: + content = item._text + logger.warning("Problem during prepare item with UID '%s' (content below): %s\n%s", item.uid, e, content) + else: + logger.warning("Problem during prepare item with UID '%s' (content suppressed in this loglevel): %s", item.uid, e) + raise items.append(item) elif not write_whole_collection: vobject_item, = vobject_items