some tweaks mainly for electron support

This commit is contained in:
azivner
2017-11-05 17:58:55 -05:00
parent 0481b1b79c
commit b890c9982b
7 changed files with 101 additions and 13 deletions

View File

@@ -225,7 +225,22 @@ async function sync() {
};
}
const syncContext = await login();
try {
const syncContext = await login();
}
catch (e) {
if (e.message.indexOf('ECONNREFUSED') !== -1) {
logSync("No connection to sync server.");
return {
success: false,
message: "No connection to sync server."
};
}
else {
throw e;
}
}
await pushSync(syncContext);
@@ -261,8 +276,6 @@ function logSyncError(message, e) {
completeMessage += ", inner exception: " + e.stack;
}
log.info(completeMessage);
throw new Error(completeMessage);
}