示例#1
0
        private static Exception Unwrap(FaultException faultException)
        {
            FaultException <ExceptionDetailNoStackTrace> faultException1 = faultException as FaultException <ExceptionDetailNoStackTrace>;

            if (faultException1 != null && faultException1.Detail != null)
            {
                return(MessagingExceptionHelper.ConvertExceptionFromDetail(faultException1.Detail.Type, faultException1));
            }
            FaultException <ExceptionDetail> faultException2 = faultException as FaultException <ExceptionDetail>;

            if (faultException2 == null || faultException2.Detail == null)
            {
                return(MessagingExceptionHelper.ConvertExceptionFromStatusCode(faultException));
            }
            return(MessagingExceptionHelper.ConvertExceptionFromDetail(faultException2.Detail.Type, faultException2));
        }
示例#2
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);
        }
示例#3
0
        public static CommunicationException ConvertToCommunicationException(MessagingException exception)
        {
            bool flag;

            return(MessagingExceptionHelper.ConvertToCommunicationException(exception, out flag));
        }