共用方式為


WcfExceptionHandler Class

Definition

This class provide handling of WCF exceptions encountered in communicating with a service fabric service that is using WCF based communication listener.

public class WcfExceptionHandler : Microsoft.ServiceFabric.Services.Communication.Client.IExceptionHandler
type WcfExceptionHandler = class
    interface IExceptionHandler
Public Class WcfExceptionHandler
Implements IExceptionHandler
Inheritance
WcfExceptionHandler
Implements

Remarks

The exceptions are handled as per the description below:

The following exceptions indicate service failover. These exceptions are handled by returning ExceptionHandlingRetryResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method. The IsTransient property of the ExceptionHandlingRetryResult is set to false, the RetryDelay property is set to a random value up to MaxRetryBackoffIntervalOnNonTransientErrors and MaxRetryCount property is set to MaxValue.
The following exceptions indicate transient error conditions and handled by returning ExceptionHandlingRetryResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method. The IsTransient property of the ExceptionHandlingRetryResult is set to true, the RetryDelay property is set to a random value up to MaxRetryBackoffIntervalOnTransientErrors and MaxRetryCount property is set to MaxValue.
The following exceptions indicate mismatch in the binding or contract between the client and the service. These exceptions are handled by returning ExceptionHandlingThrowResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method.
The following exceptions are indicate an error from the service. They are handled by returning ExceptionHandlingThrowResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method.
All other exceptions that are CommunicationException, but not FaultException are handled by returning ExceptionHandlingRetryResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method. The IsTransient property of the ExceptionHandlingRetryResult is set to true, the RetryDelay property is set to a random value up to MaxRetryBackoffIntervalOnTransientErrors and MaxRetryCount property is set to DefaultMaxRetryCountForTransientErrors.

Constructors

WcfExceptionHandler()

Initializes a new instance of the WcfExceptionHandler class.

Explicit Interface Implementations

IExceptionHandler.TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult)

Method that examines the exception and determines how that exception can be handled.

Applies to