internal static Exception ConvertToIoTHubException(Exception exception, AmqpObject source) { Exception e = ConvertToIoTHubException(exception); if (source.IsClosing() && (e is InvalidOperationException || e is OperationCanceledException)) { return(new IotHubCommunicationException("Amqp resource is disconnected.")); } else { return(e); } }
internal static Exception ConvertToIoTHubException(Exception exception, AmqpObject source) { Exception e = ConvertToIoTHubException(exception); if (source.IsClosing() && (e is InvalidOperationException || e is OperationCanceledException)) { return(RESOUCE_DISCONNECTED_EXCEPTION); } else { return(e); } }