From 17b4ab3d98439cf5e7e7893da1f1b9f6a08ab82c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 27 Oct 2017 18:58:03 -0300 Subject: [bug] set errbacks before gathering results --- src/leap/soledad/common/couch/state.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/leap/soledad/common/couch/state.py b/src/leap/soledad/common/couch/state.py index 38098e3f..5614b32f 100644 --- a/src/leap/soledad/common/couch/state.py +++ b/src/leap/soledad/common/couch/state.py @@ -93,9 +93,8 @@ def _check_db_schema_version(url, db, auth, agent=None): def _stop(failure, reactor): - exception = failure.value.subFailure.value logger.error("Failure while checking schema versions: %r - %s" - % (exception, exception.message)) + % (failure, failure.message)) reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1) reactor.stop() @@ -124,9 +123,9 @@ def check_schema_versions(couch_url, agent=None, reactor=reactor): if not db.startswith('user-'): continue d = semaphore.run(_check_db_schema_version, url, db, auth, agent=agent) + d.addErrback(_stop, reactor=reactor) deferreds.append(d) d = defer.gatherResults(deferreds, consumeErrors=True) - d.addErrback(_stop, reactor=reactor) yield d -- cgit v1.2.3