Merge pull request #847 from wabbajack-tools/dont-retry-http-response-errors

Don't retry http response errors
This commit is contained in:
Timothy Baldridge 2020-05-16 10:24:38 -07:00 committed by GitHub
commit b9592175b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,12 +76,15 @@ namespace Wabbajack.Common.Http
var response = await ClientFactory.Client.SendAsync(msg, responseHeadersRead);
if (response.IsSuccessStatusCode) return response;
if (errorsAsExceptions)
throw new HttpRequestException($"Http Exception {response.StatusCode} - {response.ReasonPhrase} - {msg.RequestUri}");;
if (errorsAsExceptions)
throw new HttpRequestException(
$"Http Exception {response.StatusCode} - {response.ReasonPhrase} - {msg.RequestUri}");
;
return response;
}
catch (Exception)
catch (Exception ex)
{
if (ex is HttpRequestException) throw;
if (retries > Consts.MaxHTTPRetries) throw;
retries++;