From 20eda60fdff3de483451c38838763290815e60a6 Mon Sep 17 00:00:00 2001 From: abraunegg Date: Mon, 13 May 2019 09:10:19 -0400 Subject: [PATCH] Catch a curl timeout exception (#499) * Catch a curl timeout exception * If we hit a curl exception, log that we hit this, as the handling of the exception in 'some' instances may actually not log an error as to 'why' --- src/onedrive.d | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/onedrive.d b/src/onedrive.d index d01701e7..4a773528 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -132,7 +132,12 @@ final class OneDriveApi try { refreshToken = readText(cfg.refreshTokenFilePath); } catch (FileException e) { - return authorize(); + try { + return authorize(); + } catch (CurlException e) { + log.error("Cannot authorize with Microsoft OneDrive Service"); + return false; + } } return true; } else { @@ -588,8 +593,7 @@ final class OneDriveApi http.perform(); } catch (CurlException e) { // Potentially Timeout was reached on handle error - // we issue warning/error in the catch routines so no need to warn here - // log.error("\nAccess to the Microsoft OneDrive service timed out - Internet connectivity issue?\n"); + log.error("\nThere was a problem in accessing the Microsoft OneDrive service - Internet connectivity issue?\n"); throw e; }