public static CommunicationException ConvertToCommunicationException(MessagingException exception, out bool shouldFault) { shouldFault = false; if (exception is MessagingEntityNotFoundException) { shouldFault = true; return(new EndpointNotFoundException(exception.Message, exception)); } if (exception is MessagingCommunicationException) { EndpointNotFoundException innerException = exception.InnerException as EndpointNotFoundException; if (innerException != null) { shouldFault = true; return(innerException); } } CommunicationException communicationException = exception.InnerException as CommunicationException ?? new CommunicationException(exception.Message, exception); return(communicationException); }
public static CommunicationException ConvertToCommunicationException(MessagingException exception) { bool flag; return(MessagingExceptionHelper.ConvertToCommunicationException(exception, out flag)); }