For retryable SpannerException, this value represents
the recommended minimum retry delay. It might or might not
be present, even if this exception is retryable.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSpannerException\u003c/code\u003e class represents errors that occur when communicating with the Spanner database, inheriting from \u003ccode\u003eException\u003c/code\u003e and implementing \u003ccode\u003eISerializable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple versions of the \u003ccode\u003eSpannerException\u003c/code\u003e available, ranging from the latest beta version \u003ccode\u003e5.0.0-beta05\u003c/code\u003e down to version \u003ccode\u003e3.5.0\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSpannerException\u003c/code\u003e provides properties like \u003ccode\u003eErrorCode\u003c/code\u003e, \u003ccode\u003eIsRetryable\u003c/code\u003e, \u003ccode\u003eRecommendedRetryDelay\u003c/code\u003e, and \u003ccode\u003eRpcException\u003c/code\u003e to help diagnose and handle errors, with \u003ccode\u003eIsRetryable\u003c/code\u003e indicating if the error is transient.\u003c/p\u003e\n"],["\u003cp\u003eThe class has two constructors, one for creating an exception with an error code and a message, and another protected one for creating an exception from a \u003ccode\u003eStatus\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt contains a list of members it inherits from the \u003ccode\u003eException\u003c/code\u003e and \u003ccode\u003eObject\u003c/code\u003e classes, and details on how to use the extension method \u003ccode\u003eTransientFaultDetector.IsTransientSpannerFault(Exception)\u003c/code\u003e to detect transient Spanner faults.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Spanner.Data - Class SpannerException (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerException)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/5.0.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.6.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.5.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.4.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.3.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.2.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.1.0/Google.Cloud.Spanner.Data.SpannerException)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.0.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.15.1/Google.Cloud.Spanner.Data.SpannerException)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.14.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.13.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.12.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.11.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.10.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.9.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.8.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.7.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.6.0/Google.Cloud.Spanner.Data.SpannerException)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.5.0/Google.Cloud.Spanner.Data.SpannerException) \n\n public class SpannerException : Exception, ISerializable\n\nReference documentation and code samples for the Google.Cloud.Spanner.Data class SpannerException.\n\nRepresents an error communicating with the Spanner database. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [Exception](https://learn.microsoft.com/dotnet/api/system.exception) \\\u003e SpannerException \n\nImplements\n----------\n\n[ISerializable](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable) \n\nInherited Members\n-----------------\n\n[Exception.GetBaseException()](https://learn.microsoft.com/dotnet/api/system.exception.getbaseexception) \n[Exception.GetObjectData(SerializationInfo, StreamingContext)](https://learn.microsoft.com/dotnet/api/system.exception.getobjectdata) \n[Exception.GetType()](https://learn.microsoft.com/dotnet/api/system.exception.gettype) \n[Exception.ToString()](https://learn.microsoft.com/dotnet/api/system.exception.tostring) \n[Exception.Data](https://learn.microsoft.com/dotnet/api/system.exception.data) \n[Exception.HelpLink](https://learn.microsoft.com/dotnet/api/system.exception.helplink) \n[Exception.HResult](https://learn.microsoft.com/dotnet/api/system.exception.hresult) \n[Exception.InnerException](https://learn.microsoft.com/dotnet/api/system.exception.innerexception) \n[Exception.Message](https://learn.microsoft.com/dotnet/api/system.exception.message) \n[Exception.Source](https://learn.microsoft.com/dotnet/api/system.exception.source) \n[Exception.StackTrace](https://learn.microsoft.com/dotnet/api/system.exception.stacktrace) \n[Exception.TargetSite](https://learn.microsoft.com/dotnet/api/system.exception.targetsite) \n[Exception.SerializeObjectState](https://learn.microsoft.com/dotnet/api/system.exception.serializeobjectstate) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n\nDerived Types\n-------------\n\n[SpannerBatchNonQueryException](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerBatchNonQueryException)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.Data](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Data.dll\n\nConstructors\n------------\n\n### SpannerException(ErrorCode, string)\n\n public SpannerException(ErrorCode code, string message)\n\nCreates a new instance of [SpannerException](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerException)\n\n### SpannerException(Status)\n\n protected SpannerException(Status status)\n\nCreates a new instance of [SpannerException](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerException).\n\nProperties\n----------\n\n### ErrorCode\n\n public ErrorCode ErrorCode { get; }\n\nAn error code that indicates the general class of problem.\n\n### IsRetryable\n\n public bool IsRetryable { get; }\n\nIf true, the error was likely a transient error and a retry of the operation may succeed.\n\n### RecommendedRetryDelay\n\n public TimeSpan? RecommendedRetryDelay { get; }\n\nFor retryable [SpannerException](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerException), this value represents\nthe recommended minimum retry delay. It might or might not\nbe present, even if this exception is retryable.\n\n### RpcException\n\n public RpcException RpcException { get; }\n\nReturns the underlying [RpcException](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.RpcException.html). The returned value\nmay be null if the [SpannerException](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerException) was not caused by an RpcException.\n\nExtension Method\n----------------\n\n[TransientFaultDetector.IsTransientSpannerFault(Exception)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.TransientFaultDetector#Google_Cloud_Spanner_Data_TransientFaultDetector_IsTransientSpannerFault_System_Exception_)"]]