From 11138602ed6bb1b7870ea71af2f6e9bffc323497 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 29 Nov 2018 18:48:24 +0900 Subject: [PATCH] gracefully handle connection errors in monitor mode (#253) * gracefully handle connection errors, resolve issue #234 --- src/main.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.d b/src/main.d index e3ff8675..67559231 100644 --- a/src/main.d +++ b/src/main.d @@ -374,7 +374,13 @@ int main(string[] args) if (!downloadOnly) m.update(online); auto currTime = MonoTime.currTime(); if (currTime - lastCheckTime > checkInterval) { - online = testNetwork(); + try { + online = testNetwork(); + } catch (CurlException e) { + // No network connection to OneDrive Service + log.log("No network connection to Microsoft OneDrive Service, skipping sync"); + online = false; + } if (online) { performSync(sync, singleDirectory, downloadOnly, localFirst, uploadOnly); if (!downloadOnly) {