summaryrefslogtreecommitdiff
path: root/src
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
commit1568761f4fa7a7f8a9b0caec79ed2552b6c73ba7 (patch)
treeed21b28ea4afa92df0af34f1339de402d01419aa /src
parent8603664204f9d760c1e332e70686e4dd63108091 (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 'src')
-rw-r--r--src/leap/mail/mail.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/leap/mail/mail.py b/src/leap/mail/mail.py
index 57d96ef..d92ff79 100644
--- a/src/leap/mail/mail.py
+++ b/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)