Skip to content

Commit

Permalink
Fix testInternetReachability function
Browse files Browse the repository at this point in the history
* Function should always return a boolean value and not throw an exception
  • Loading branch information
abraunegg committed Jan 25, 2025
1 parent defcd8b commit fbe8f3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.d
Original file line number Diff line number Diff line change
Expand Up @@ -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!({}));
Expand Down

0 comments on commit fbe8f3c

Please sign in to comment.