From 80e37a761656bf2aedbc30a3e3add432fbed3ca7 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 5 Mar 2015 12:20:45 -0400 Subject: [bug] catch null doc_id error, and log it as such Catch null doc_id so that we don't interrupt server This bug needs further investigation Related: #6769 ? --- mail/src/leap/mail/mail.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mail/src/leap/mail/mail.py b/mail/src/leap/mail/mail.py index 57d96efa..d92ff793 100644 --- a/mail/src/leap/mail/mail.py +++ b/mail/src/leap/mail/mail.py @@ -562,6 +562,15 @@ class MessageCollection(object): def insert_mdoc_id(_, wrapper): doc_id = wrapper.mdoc.doc_id + if not doc_id: + # --- BUG ----------------------------------------- + # XXX why from time to time mdoc doesn't have doc_id + # here??? + logger.error("BUG: (please report) Null doc_id for " + "document %s" % + (wrapper.mdoc.serialize(),)) + return defer.succeed("mdoc_id not inserted") + # XXX BUG ----------------------------------------- return self.mbox_indexer.insert_doc( self.mbox_uuid, doc_id) -- cgit v1.2.3