mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
parent
34ac29fc2a
commit
826a64226e
3 changed files with 30 additions and 6 deletions
|
|
@ -9,6 +9,12 @@ Package maintainers and users who have to manually update their installation
|
||||||
may want to subscribe to `GitHub's tag feed
|
may want to subscribe to `GitHub's tag feed
|
||||||
<https://github.com/pimutils/vdirsyncer/tags.atom>`_.
|
<https://github.com/pimutils/vdirsyncer/tags.atom>`_.
|
||||||
|
|
||||||
|
Version 0.14.0
|
||||||
|
==============
|
||||||
|
|
||||||
|
- ``vdirsyncer sync`` now continues other uploads if one upload failed. The
|
||||||
|
exit code in such situations is still non-zero.
|
||||||
|
|
||||||
Version 0.13.1
|
Version 0.13.1
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,18 +56,33 @@ def sync_collection(wq, collection, general, force_delete):
|
||||||
|
|
||||||
a = storage_instance_from_config(collection.config_a)
|
a = storage_instance_from_config(collection.config_a)
|
||||||
b = storage_instance_from_config(collection.config_b)
|
b = storage_instance_from_config(collection.config_b)
|
||||||
|
|
||||||
|
sync_failed = False
|
||||||
|
|
||||||
|
def error_callback(e):
|
||||||
|
nonlocal sync_failed
|
||||||
|
sync_failed = True
|
||||||
|
handle_cli_error(status_name, e)
|
||||||
|
|
||||||
sync(
|
sync(
|
||||||
a, b, status,
|
a, b, status,
|
||||||
conflict_resolution=pair.conflict_resolution,
|
conflict_resolution=pair.conflict_resolution,
|
||||||
force_delete=force_delete
|
force_delete=force_delete,
|
||||||
|
error_callback=error_callback
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
save_status(general['status_path'], pair.name, collection.name,
|
||||||
|
data_type='items', data=status)
|
||||||
|
|
||||||
|
if sync_failed:
|
||||||
|
raise JobFailed()
|
||||||
|
except JobFailed:
|
||||||
|
raise
|
||||||
except BaseException:
|
except BaseException:
|
||||||
handle_cli_error(status_name)
|
handle_cli_error(status_name)
|
||||||
raise JobFailed()
|
raise JobFailed()
|
||||||
|
|
||||||
save_status(general['status_path'], pair.name, collection.name,
|
|
||||||
data_type='items', data=status)
|
|
||||||
|
|
||||||
|
|
||||||
def discover_collections(wq, pair, **kwargs):
|
def discover_collections(wq, pair, **kwargs):
|
||||||
rv = collections_for_pair(pair=pair, **kwargs)
|
rv = collections_for_pair(pair=pair, **kwargs)
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class JobFailed(RuntimeError):
|
||||||
|
|
||||||
|
|
||||||
# TODO: Making this a decorator would be nice
|
# TODO: Making this a decorator would be nice
|
||||||
def handle_cli_error(status_name=None):
|
def handle_cli_error(status_name=None, e=None):
|
||||||
'''
|
'''
|
||||||
Print a useful error message for the current exception.
|
Print a useful error message for the current exception.
|
||||||
|
|
||||||
|
|
@ -80,7 +80,10 @@ def handle_cli_error(status_name=None):
|
||||||
'''
|
'''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
raise
|
if e is not None:
|
||||||
|
raise e
|
||||||
|
else:
|
||||||
|
raise
|
||||||
except exceptions.UserError as e:
|
except exceptions.UserError as e:
|
||||||
cli_logger.critical(e)
|
cli_logger.critical(e)
|
||||||
except StorageEmpty as e:
|
except StorageEmpty as e:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue