Google.Cloud.Spanner.Data - Class TransientFaultDetector (5.0.0-beta04)

public static class TransientFaultDetector

Reference documentation and code samples for the Google.Cloud.Spanner.Data class TransientFaultDetector.

Transactions can be retried using the Transient Fault Handling Application Block. This extension helps you create a strategy that will detect transient faults when performing transactions with Spanner. To create an execution strategy, create a class

class SpannerTransientErrorDetectionStrategy : ITransientErrorDetectionStrategy
{
  public bool IsTransient(Exception ex) => ex.IsTransientSpannerFault();
}

Inheritance

object > TransientFaultDetector

Namespace

Google.Cloud.Spanner.Data

Assembly

Google.Cloud.Spanner.Data.dll

Methods

IsTransientSpannerFault(Exception)

public static bool IsTransientSpannerFault(this Exception exception)

Returns true if the exception represents a transient error in Spanner. This indicates that the operation may succeed if it is attempted again. Common errors that can cause this include temporary network interruption or the service being temporarily unavailable.

Parameter
Name Description
exception Exception
Returns
Type Description
bool

True if the exception represents an error that may succeed on a retry.