diff --git a/src/main.d b/src/main.d index 67559231..138a56e5 100644 --- a/src/main.d +++ b/src/main.d @@ -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 diff --git a/src/onedrive.d b/src/onedrive.d index 3854be15..b2d95bf7 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -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;