From 133c45e5455cb072509561a5b672f12beb222310 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 23 Nov 2019 04:43:28 +0900 Subject: [PATCH] Catch DNS resolution error (#730) * Catch the DNS error the same way we catch the timeout error --- src/onedrive.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/onedrive.d b/src/onedrive.d index 5b04dd43..95858d06 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -635,7 +635,8 @@ final class OneDriveApi auto errorArray = splitLines(e.msg); string errorMessage = errorArray[0]; - if (canFind(errorMessage, "Couldn't connect to server on handle")) { + if (canFind(errorMessage, "Couldn't connect to server on handle") || + canFind(errorMessage, "Couldn't resolve host name on handle")) { // This is a curl timeout log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?"); // or 408 request timeout @@ -661,7 +662,8 @@ final class OneDriveApi log.log("Internet connectivity to Microsoft OneDrive service has been restored"); retrySuccess = true; } catch (CurlException e) { - if (canFind(e.msg, "Couldn't connect to server on handle")) { + if (canFind(e.msg, "Couldn't connect to server on handle") || + canFind(e.msg, "Couldn't resolve host name on handle")) { log.error(" Error Message: There was a timeout in accessing the Microsoft OneDrive service - Internet connectivity issue?"); // Increment & loop around retryAttempts++;