コード例 #1
0
        public static Exception Unwrap(CommunicationException exception)
        {
            if (exception == null)
            {
                return(null);
            }
            FaultException faultException = exception as FaultException;

            if (faultException != null)
            {
                return(MessagingExceptionHelper.Unwrap(faultException));
            }
            EndpointNotFoundException endpointNotFoundException = exception as EndpointNotFoundException;

            if (endpointNotFoundException != null)
            {
                return(new MessagingCommunicationException(endpointNotFoundException.Message, endpointNotFoundException));
            }
            if (exception is CommunicationObjectAbortedException)
            {
                return(new OperationCanceledException(SRClient.EntityClosedOrAborted, exception));
            }
            if (exception is CommunicationObjectFaultedException)
            {
                return(new MessagingCommunicationException(SRClient.MessagingCommunicationError, exception));
            }
            return(new MessagingCommunicationException(exception.Message, exception));
        }
コード例 #2
0
        public static bool IsWrappedExceptionTransient(this Exception exception)
        {
            bool isTransient;
            CommunicationException communicationException = exception as CommunicationException;

            if (communicationException == null)
            {
                isTransient = false;
            }
            else
            {
                Exception          exception1          = MessagingExceptionHelper.Unwrap(communicationException);
                MessagingException messagingException  = exception1 as MessagingException;
                MessagingException messagingException1 = messagingException;
                if (messagingException == null)
                {
                    isTransient = (!(exception1 is TimeoutException) ? false : true);
                }
                else
                {
                    isTransient = messagingException1.IsTransient;
                }
            }
            return(isTransient);
        }
コード例 #3
0
 public static Exception Unwrap(CommunicationException exception, bool isCancelling)
 {
     if (!isCancelling)
     {
         return(MessagingExceptionHelper.Unwrap(exception));
     }
     if (exception is CommunicationObjectAbortedException)
     {
         return(new OperationCanceledException(SRClient.EntityClosedOrAborted, exception));
     }
     return(new OperationCanceledException(SRClient.EntityClosedOrAborted, MessagingExceptionHelper.Unwrap(exception)));
 }
コード例 #4
0
        private Exception ProcessException(Exception exception)
        {
            if (base.IsClosedOrClosing)
            {
                return(new OperationCanceledException(SRClient.EntityClosedOrAborted, exception));
            }
            if (!(exception is CommunicationException))
            {
                if (exception is SessionLockLostException)
                {
                    this.AbortInnerReceiverAndFault();
                }
                return(exception);
            }
            Exception exception1 = MessagingExceptionHelper.Unwrap((CommunicationException)exception, base.IsClosedOrClosing);

            if (exception1 is SessionLockLostException)
            {
                this.AbortInnerReceiverAndFault();
            }
            return(exception1);
        }