mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix testInternetReachability function (#3087)
* Function should always return a boolean value and not throw an exception
This commit is contained in:
parent
defcd8bf2d
commit
e392722b5e
1 changed files with 2 additions and 2 deletions
|
|
@ -255,11 +255,11 @@ bool testInternetReachability(ApplicationConfig appConfig) {
|
|||
// Check response for HTTP status code
|
||||
if (http.statusLine.code >= 200 && http.statusLine.code < 400) {
|
||||
addLogEntry("Successfully reached Microsoft OneDrive Login Service");
|
||||
return true;
|
||||
} else {
|
||||
addLogEntry("Failed to reach Microsoft OneDrive Login Service. HTTP status code: " ~ to!string(http.statusLine.code));
|
||||
throw new Exception("HTTP Request Failed with Status Code: " ~ to!string(http.statusLine.code));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} catch (SocketException e) {
|
||||
addLogEntry("Cannot connect to Microsoft OneDrive Service - Socket Issue: " ~ e.msg);
|
||||
displayOneDriveErrorMessage(e.msg, getFunctionName!({}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue