KafkaNet.KafkaTcpSocket.WrappedException C# (CSharp) Method

WrappedException() private method

private WrappedException ( Exception ex ) : Exception
ex System.Exception
return System.Exception
        private Exception WrappedException(Exception ex)
        {
            Exception wrappedException;
            if (_disposeToken.IsCancellationRequested)
                wrappedException = new ObjectDisposedException(string.Format("Object is disposing (KafkaTcpSocket for endpoint: {0})", Endpoint));
            else
                wrappedException = new BrokerConnectionException(string.Format("Lost connection to server: {0}", _endpoint), _endpoint, ex);

            return wrappedException;
        }