#98, better error reporting for sync setup

This commit is contained in:
azivner
2018-07-25 22:54:37 +02:00
parent d39cdbfada
commit 02dc7b199b
7 changed files with 33 additions and 22 deletions

View File

@@ -38,7 +38,12 @@ async function setupSyncToSyncServer() {
rpOpts.proxy = syncProxy;
}
await rp(rpOpts);
try {
await rp(rpOpts);
}
catch (e) {
return { success: false, error: e.message };
}
// this is completely new sync, need to reset counters. If this would not be new sync,
// the previous request would have failed.
@@ -46,6 +51,8 @@ async function setupSyncToSyncServer() {
await optionService.setOption('lastSyncedPull', 0);
syncService.sync();
return { success: true };
}
async function saveSyncSeed(req) {