thrownewException($"ERROR: Remote server returns '{responseMessage.StatusCode}'");
thrownewException($"ERROR: Remote server returns '{responseMessage.StatusCode}'");
@ -95,19 +109,21 @@ namespace Volo.Abp.Cli.NuGet
.OrResult(msg=>!msg.IsSuccessStatusCode)
.OrResult(msg=>!msg.IsSuccessStatusCode)
.WaitAndRetryAsync(new[]
.WaitAndRetryAsync(new[]
{
{
TimeSpan.FromSeconds(1)
TimeSpan.FromSeconds(2),
TimeSpan.FromSeconds(4),
TimeSpan.FromSeconds(7)
},
},
(responseMessage,timeSpan,retryCount,context)=>
(responseMessage,timeSpan,retryCount,context)=>
{
{
if(responseMessage.Exception!=null)
if(responseMessage.Exception!=null)
{
{
Logger.LogDebug(
Logger.LogWarning(
$"{retryCount}. HTTP request attempt failed to {url} with an error: HTTP {(int)responseMessage.Result.StatusCode}-{responseMessage.Exception.Message}. "+
$"{retryCount}. HTTP request attempt failed to {url} with an error: HTTP {(int)responseMessage.Result.StatusCode}-{responseMessage.Exception.Message}. "+
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
}
}
elseif(responseMessage.Result!=null)
elseif(responseMessage.Result!=null)
{
{
Logger.LogDebug(
Logger.LogWarning(
$"{retryCount}. HTTP request attempt failed to {url} with an error: {(int)responseMessage.Result.StatusCode}-{responseMessage.Result.ReasonPhrase}. "+
$"{retryCount}. HTTP request attempt failed to {url} with an error: {(int)responseMessage.Result.StatusCode}-{responseMessage.Result.ReasonPhrase}. "+
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");
$"Waiting {timeSpan.TotalSeconds} secs for the next try...");