Просмотр исходного кода

extend broken vcalendar item log

Peter Bieringer 3 месяцев назад
Родитель
Сommit
56e0362f59
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      radicale/app/put.py

+ 6 - 2
radicale/app/put.py

@@ -93,9 +93,13 @@ def prepare(vobject_items: List[vobject.base.Component], path: str,
                     logger.debug("Prepare item with UID '%s'", item.uid)
                     logger.debug("Prepare item with UID '%s'", item.uid)
                     try:
                     try:
                         item.prepare()
                         item.prepare()
-                    except ValueError as e:
+                    except (RuntimeError, ValueError, AttributeError) as e:
                         if logger.isEnabledFor(logging.DEBUG):
                         if logger.isEnabledFor(logging.DEBUG):
-                            logger.warning("Problem during prepare item with UID '%s' (content below): %s\n%s", item.uid, e, item._text)
+                            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:
                         else:
                             logger.warning("Problem during prepare item with UID '%s' (content suppressed in this loglevel): %s", item.uid, e)
                             logger.warning("Problem during prepare item with UID '%s' (content suppressed in this loglevel): %s", item.uid, e)
                         raise
                         raise