continue in monitor mode when sync timed out (#265)

* update handling of connection timeouts in monitor mode & allow application continue rather than exit
This commit is contained in:
Norbert Preining 2018-12-03 11:41:31 +09:00 committed by abraunegg
parent c24e4b0b1e
commit 9817104ca1
2 changed files with 10 additions and 5 deletions

View file

@ -382,10 +382,15 @@ int main(string[] args)
online = false;
}
if (online) {
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
if (!downloadOnly) {
// discard all events that may have been generated by the sync
m.update(false);
try {
performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly);
if (!downloadOnly) {
// discard all events that may have been generated by the sync
m.update(false);
}
} catch (CurlException e) {
// TODO better check of type of exception from Curl
log.log("No network connection to Microsoft OneDrive Service, skipping sync");
}
}
// performSync complete, set lastCheckTime to current time

View file

@ -523,7 +523,7 @@ final class OneDriveApi
} catch (CurlException e) {
// Potentially Timeout was reached on handle error
log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n");
exit(-1);
throw e;
}
JSONValue json;