mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
#98, better error reporting for sync setup
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user