diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-10-05 18:09:34 -0300 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-10-13 16:15:09 -0400 |
commit | 60cb0fe4eb18669a0b4b213d74c11b2ff60118a1 (patch) | |
tree | 21bff42807fb94e8385d68ceaea9c989f5f73887 /client/src/leap | |
parent | a1906cf4e808ddf64b6117334112ada830e5eb1a (diff) |
[bug] handle MissingDesignDocError after get_sync_info
MissingDesignDocError raised on get_sync_info due to a missing design
document will be handled by the server during sync.
Ensure is now False by default, and thus database creation can deliver
an empty one that will be ensured during sync, following the ensure
parameter.
Diffstat (limited to 'client/src/leap')
-rw-r--r-- | client/src/leap/soledad/client/sync.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/leap/soledad/client/sync.py b/client/src/leap/soledad/client/sync.py index 225d3e2d..2276db2a 100644 --- a/client/src/leap/soledad/client/sync.py +++ b/client/src/leap/soledad/client/sync.py @@ -22,6 +22,7 @@ import logging from twisted.internet import defer from u1db import errors +from leap.soledad.common.errors import MissingDesignDocError from u1db.sync import Synchronizer @@ -73,8 +74,9 @@ class SoledadSynchronizer(Synchronizer): (self.target_replica_uid, target_gen, target_trans_id, target_my_gen, target_my_trans_id) = yield \ sync_target.get_sync_info(self.source._replica_uid) - except errors.DatabaseDoesNotExist: + except (errors.DatabaseDoesNotExist, MissingDesignDocError) as e: logger.debug("Database isn't ready on server. Will be created.") + logger.debug("Reason: %s", e.__class__) self.target_replica_uid = None target_gen, target_trans_id = 0, '' target_my_gen, target_my_trans_id = 0, '' |