You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Microsoft.Rest.ClientRuntime.2.3.12, when you create a new RetryDelegatingHandler using the default CTOR, everything worked fine, and you could then assign the InnerHandler (which is of type HttpMessageHandler):
var handler = new RetryDelegatingHandler();
handler.RetryPolicy = retryPolicy;
handler.InnerHandler = new WebRequestHandler();
In Microsoft.Rest.ClientRuntime.2.3.15, this results in an ArgumentNullException, and you much provide a DelegatingHandler instance yourself. Notice, that since the CTOR requires a DelegatingHandler, you can't pass an WebRequestHandler instance like I did in the above code, and I now need to jump thru some hoops:
var handler = new RetryDelegatingHandler(retryPolicy, new SendableHandler(new WebRequestHandler()));
private class SendableHandler : DelegatingHandler
{
public SendableHandler(HttpMessageHandler innerHandler) : base(innerHandler) { }
public new Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken)
{
return base.SendAsync(request, cancellationToken);
}
}
The text was updated successfully, but these errors were encountered:
In Microsoft.Rest.ClientRuntime.2.3.12, when you create a new RetryDelegatingHandler using the default CTOR, everything worked fine, and you could then assign the InnerHandler (which is of type
HttpMessageHandler
):In Microsoft.Rest.ClientRuntime.2.3.15, this results in an ArgumentNullException, and you much provide a
DelegatingHandler
instance yourself. Notice, that since the CTOR requires a DelegatingHandler, you can't pass anWebRequestHandler
instance like I did in the above code, and I now need to jump thru some hoops:The text was updated successfully, but these errors were encountered: