Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SafeKafkaHandle.ListGroup throws exception #34
The below method in SafeKafkaHandle will throw an exception when a non-existent group name is passed:
The exception is due to the implementation of Single() in .NET, where the sequence you invoke it on needs to contain 1 and only 1 item that matches the predicate (in this case no predicate). A different option is SingleOrDefault(), even better is probably FirstOrDefault() as using 'firs't is typically going to perform better as the 'single' methods need to scan the entire collection to make sure there are no duplicates. In this case there should never be more than one so it shouldn't matter.