summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-03-05 12:20:45 -0400
committerKali Kaneko <kali@leap.se>2015-03-05 15:18:25 -0400
commit80e37a761656bf2aedbc30a3e3add432fbed3ca7 (patch)
tree96b82853d7c2a3662c6572e80f6d11b714c67c42 /mail
parent5c2a6487a8a291e4b0f54c62d19f3ad3a07e7991 (diff)
[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 ?
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/mail.py9
1 files changed, 9 insertions, 0 deletions
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)