Google.Cloud.Spanner.Data - Class SpannerException (4.5.0)

public class SpannerException : Exception, ISerializable

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

Represents an error communicating with the Spanner database.

Inheritance

object > Exception > SpannerException

Implements

ISerializable

Namespace

Google.Cloud.Spanner.Data

Assembly

Google.Cloud.Spanner.Data.dll

Constructors

SpannerException(ErrorCode, string)

public SpannerException(ErrorCode code, string message)

Creates a new instance of SpannerException

Parameters
NameDescription
codeErrorCode

The ErrorCode for the exception.

messagestring

A descriptive message about the exception.

SpannerException(Status)

protected SpannerException(Status status)

Creates a new instance of SpannerException.

Parameter
NameDescription
statusStatus

The value from which to create the exception from.

Properties

ErrorCode

public ErrorCode ErrorCode { get; }

An error code that indicates the general class of problem.

Property Value
TypeDescription
ErrorCode

IsRetryable

public bool IsRetryable { get; }

If true, the error was likely a transient error and a retry of the operation may succeed.

Property Value
TypeDescription
bool

RecommendedRetryDelay

public TimeSpan? RecommendedRetryDelay { get; }

For retryable SpannerException, this value represents the recommended minimum retry delay. It might or might not be present, even if this exception is retryable.

Property Value
TypeDescription
TimeSpan

RpcException

public RpcException RpcException { get; }

Returns the underlying RpcException. The returned value may be null if the SpannerException was not caused by an RpcException.

Property Value
TypeDescription
RpcException

Extension Method