summaryrefslogtreecommitdiff
path: root/src/leap/mx
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/mx')
-rw-r--r--src/leap/mx/couchdbhelper.py9
-rw-r--r--src/leap/mx/tests/test_mail_receiver.py4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py
index 50275ca..eafc620 100644
--- a/src/leap/mx/couchdbhelper.py
+++ b/src/leap/mx/couchdbhelper.py
@@ -184,7 +184,8 @@ class ConnectedCouchDB(client.CouchDB):
:return: A deferred which fires with the new revision identifier for
the document if the Document object has being updated, or
- which fails with CouchDBError if there was any error.
+ which fails with the correspondent exception if there was any
+ error.
"""
# TODO: that should be implemented with paisley
url = self._mail_couch_url + "/user-%s" % (uuid,)
@@ -192,8 +193,4 @@ class ConnectedCouchDB(client.CouchDB):
db = CouchDatabase.open_database(url, create=False)
return defer.succeed(db.put_doc(doc))
except Exception as e:
- return defer.fail(CouchDBError(e.message))
-
-
-class CouchDBError(Exception):
- pass
+ return defer.fail(e)
diff --git a/src/leap/mx/tests/test_mail_receiver.py b/src/leap/mx/tests/test_mail_receiver.py
index 33967ea..6b274cd 100644
--- a/src/leap/mx/tests/test_mail_receiver.py
+++ b/src/leap/mx/tests/test_mail_receiver.py
@@ -19,7 +19,6 @@
MailReceiver tests
"""
-import codecs
import json
import os
import os.path
@@ -31,7 +30,6 @@ from twisted.internet import defer, reactor
from twisted.trial import unittest
from leap.keymanager import openpgp
-from leap.mx.couchdbhelper import CouchDBError
from leap.mx.mail_receiver import MailReceiver
@@ -91,7 +89,7 @@ class MailReceiverTestCase(unittest.TestCase):
def put_doc_raise(*args):
defer_called.callback(None)
- return defer.fail(CouchDBError())
+ return defer.fail(Exception())
self.users_cdb.put_doc = put_doc_raise
_, path = self.addMail()