RetryPolicy.ShouldRetryAsync(HttpMessage, Exception) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This method can be overriden to control whether a request should be retried. It will be called for any response where IsError is true, or if an exception is thrown from any subsequent pipeline policies or the transport. This method will only be called for async methods.
protected internal virtual System.Threading.Tasks.ValueTask<bool> ShouldRetryAsync (Azure.Core.HttpMessage message, Exception? exception);
abstract member ShouldRetryAsync : Azure.Core.HttpMessage * Exception -> System.Threading.Tasks.ValueTask<bool>
override this.ShouldRetryAsync : Azure.Core.HttpMessage * Exception -> System.Threading.Tasks.ValueTask<bool>
Protected Friend Overridable Function ShouldRetryAsync (message As HttpMessage, exception As Exception) As ValueTask(Of Boolean)
Parameters
- message
- HttpMessage
The message containing the request and response.
- exception
- Exception
The exception that occurred, if any, which can be used to determine if a retry should occur.
Returns
Whether or not to retry.
Applies to
Azure SDK for .NET