Google Cloud Storage v1 API - Class RetryPredicate (4.5.0)

public sealed class RetryPredicate

Reference documentation and code samples for the Google Cloud Storage v1 API class RetryPredicate.

Specifies the conditions under which a failed operation is retried. This class is immutable.

Inheritance

object > RetryPredicate

Namespace

GoogleGoogle.CloudGoogle.Cloud.StorageV1

Assembly

Google.Cloud.Storage.V1.dll

Properties

Never

public static RetryPredicate Never { get; }

Returns a Retry Predicate which will ensure that the operation will never retry in case of failure.

Property Value
TypeDescription
RetryPredicate

RetriableIdempotentErrors

public static RetryPredicate RetriableIdempotentErrors { get; }

Default retriable error codes for which the operation would retry unless otherwise specified by the user.

Property Value
TypeDescription
RetryPredicate

Methods

FromErrorCodePredicate(Func<int, bool>)

public static RetryPredicate FromErrorCodePredicate(Func<int, bool> predicate)

Returns a predicate which will retry based on the result of the specified delegate, which is provided with the HTTP error code for the response.

Parameter
NameDescription
predicateFuncintbool

Predicate used to determine whether or not to retry. May be null, in which case Never will be returned.

Returns
TypeDescription
RetryPredicate

Returns the retry predicate with the conditions specified for retrying.

FromErrorCodes(params int[])

public static RetryPredicate FromErrorCodes(params int[] errorCodes)

Returns a predicate which will retry on the specified HTTP error codes. Note that only these error codes will be retried; the default error codes are not used by the returned predicate.

Parameter
NameDescription
errorCodesint

Error codes on which to retry.

Returns
TypeDescription
RetryPredicate

Returns a predicate which retries on the specified error codes.