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
System.Object
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 System.Int32.MaxValue.
  • System.ServiceModel.EndpointNotFoundException
  • System.ServiceModel.CommunicationObjectAbortedException
  • System.ServiceModel.CommunicationObjectFaultedException
  • System.ObjectDisposedException
  • System.ServiceModel.ChannelTerminatedException
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 System.Int32.MaxValue.
  • System.TimeoutException
  • System.ServiceModel.ServerTooBusyException
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.
  • System.ServiceModel.ActionNotSupportedException
  • System.ServiceModel.AddressAccessDeniedException
  • System.ServiceModel.Security.SecurityAccessDeniedException
The following exceptions are indicate an error from the service. They are handled by returning ExceptionHandlingThrowResult from the TryHandleException(ExceptionInformation, OperationRetrySettings, ExceptionHandlingResult) method.
  • System.ServiceModel.FaultException
All other exceptions that are System.ServiceModel.CommunicationException, but not System.ServiceModel.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