Don't retry http response errors

This commit is contained in:
Timothy Baldridge 2020-05-14 21:52:23 -06:00
parent 3c90084838
commit caec0e3e11

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++;