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'
This commit is contained in:
abraunegg 2019-05-13 09:10:19 -04:00 committed by GitHub
parent f779881ff9
commit 20eda60fdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}