From 6df54bf88ab67bb96d92971967d251b8267bf8ec Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 4 Sep 2016 13:23:01 +0200 Subject: [PATCH] Log name of faulty component If vobject can't parse a component it raises an exception, but the filename of that component is missing in the logs. --- radicale/storage.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radicale/storage.py b/radicale/storage.py index 8401561..867b562 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -631,7 +631,12 @@ class Collection(BaseCollection): last_modified = time.strftime( "%a, %d %b %Y %H:%M:%S GMT", time.gmtime(os.path.getmtime(path))) - return Item(self, vobject.readOne(text), href, last_modified) + try: + item = vobject.readOne(text) + except Exception: + self.logger.error("Failed to parse component: %s", href) + raise + return Item(self, item, href, last_modified) def upload(self, href, vobject_item): if not is_safe_filesystem_path_component(href):