diff options
author | drebs <drebs@leap.se> | 2017-03-12 15:39:33 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-03-17 17:30:43 +0100 |
commit | 0c227c30ee20b1af4518ecf56848b06572b4ed72 (patch) | |
tree | 957449f1d9ee745491966e86f6f14d01905a08b2 /src/leap/mx/couchdbhelper.py | |
parent | 03dcf4fcdf67f02dd913e85e89bbd6cc2a377bd9 (diff) |
Fix logging of couchdb errors.
Leap MX was previously wrapping soledad's couchdb-related exceptions
messages in its own exception. The problem was that message attribute of
those exceptions were actually empty, and so the information of the
actual error was lost. This commit removes the wrapper exception and
forwards whatever exception was received from soledad to the logging
system.
Signed-off-by: Ruben Pollan <meskio@sindominio.net>
Diffstat (limited to 'src/leap/mx/couchdbhelper.py')
-rw-r--r-- | src/leap/mx/couchdbhelper.py | 9 |
1 files changed, 3 insertions, 6 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) |