Skip to content

Commit f170f16

Browse files
committed
Catch SendAsync() exception when debugging
1 parent 96d9ea6 commit f170f16

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ArchiSteamFarm/WebBrowser.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,12 @@ private async Task<HttpResponseMessage> UrlRequest(string request, HttpMethod ht
413413

414414
try {
415415
responseMessage = await HttpClient.SendAsync(requestMessage).ConfigureAwait(false);
416-
} catch { // Request failed, we don't need to know the exact reason, swallow exception
416+
} catch (Exception e) {
417+
// This exception is really common, don't bother with it unless debug mode is enabled
418+
if (Debugging.IsDebugBuild || Program.GlobalConfig.Debug) {
419+
Logging.LogGenericException(e, Identifier);
420+
}
421+
417422
return null;
418423
}
419424
}

0 commit comments

Comments
 (0)