summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail
diff options
context:
space:
mode:
authorSriram Viswanathan <sriramv@thoughtworks.com>2017-03-16 17:06:50 -0300
committerKali Kaneko (leap communications) <kali@leap.se>2017-03-31 18:47:16 +0200
commitb553c65d1d114f2a3a4cb3282b4505838f537421 (patch)
tree2c996504feed652246427e77def9b661f32a78db /src/leap/bitmask/mail
parentcaed945c7c85800d7467f52471509afc21a6f071 (diff)
[bug] fix errBack in _decrypt_doc in incoming mail service
with @deniscostadsc
Diffstat (limited to 'src/leap/bitmask/mail')
-rw-r--r--src/leap/bitmask/mail/incoming/service.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/leap/bitmask/mail/incoming/service.py b/src/leap/bitmask/mail/incoming/service.py
index 2ecd587..e1dde02 100644
--- a/src/leap/bitmask/mail/incoming/service.py
+++ b/src/leap/bitmask/mail/incoming/service.py
@@ -337,10 +337,13 @@ class IncomingMail(Service):
"1" if success else "0")
return self._process_decrypted_doc(doc, decrdata)
+ def log_doc_id_and_raise_exception(failure):
+ logger.error(
+ '_decrypt_doc: Error decrypting document with ID %s' % doc.doc_id)
+ self._errback(failure)
+
d = self._keymanager.decrypt(doc.content[ENC_JSON_KEY], self._userid)
- d.addErrback(self._errback)
- d.addErrback(lambda _: logger.error(
- '_decrypt_doc: Error decrypting document with ID %s' % doc.doc_id))
+ d.addErrback(log_doc_id_and_raise_exception)
d.addCallback(process_decrypted)
d.addCallback(lambda data: (doc, data))
return d