Condividi tramite


FabricNotPrimaryException Class

Definition

The exception that is thrown when the callee is not a primary.

[System.Serializable]
public class FabricNotPrimaryException : System.Fabric.FabricException
[<System.Serializable>]
type FabricNotPrimaryException = class
    inherit FabricException
Public Class FabricNotPrimaryException
Inherits FabricException
Inheritance
FabricNotPrimaryException
Attributes

Remarks

The FabricNotPrimaryException indicates that the operation cannot be performed because the callee is currently not a primary. For example, this exception can be observed if a secondary replica attempted to replicate an operation via ReplicateAsync(OperationData, CancellationToken, Int64). A likely scenario is that the replica is no longer the primary.

Handling FabricNotPrimaryException for Reliable Collections : 1. If the service sees FabricNotPrimaryException in RunAsync, it should catch the exception, complete all tasks and return from RunAsync. The CancellationToken passed to RunAsync would be signalled. All background tasks should complete execution when this cancellation is signalled. 2. If the service sees FabricNotPrimaryException while processing a client request (e.g. via their communication listener), the service should throw the exception to the client to signal the client that it should re-resolve the service in order to locate the new Primary.

Constructors

FabricNotPrimaryException()

Initializes a new instance of FabricNotPrimaryException class with error code Unknown.

FabricNotPrimaryException(FabricErrorCode)

Initializes a new instance of FabricNotPrimaryException class with a specified error code.

FabricNotPrimaryException(SerializationInfo, StreamingContext, FabricErrorCode)

Initializes a new instance of FabricNotPrimaryException class with specified info, context and error code.

FabricNotPrimaryException(SerializationInfo, StreamingContext)

Initializes a new instance of FabricNotPrimaryException class with specified info, context.

FabricNotPrimaryException(String, Exception, FabricErrorCode)

Initializes a new instance of FabricNotPrimaryException class with a specified error message, a reference to the inner exception that is the cause of this exception, and a specified error code.

FabricNotPrimaryException(String, Exception)

Initializes a new instance of FabricNotPrimaryException class with a specified error message and a reference to the inner exception that is the cause of this exception.

FabricNotPrimaryException(String, FabricErrorCode)

Initializes a new instance of FabricNotPrimaryException class with specified message and error code.

FabricNotPrimaryException(String)

Initializes a new instance of FabricNotPrimaryException class with a specified message.

Properties

ErrorCode

Gets the error code parameter.

(Inherited from FabricException)

Applies to