The HttpAdminBridgeEndpoint.doGetTopic method has multiple places with code duplication when handling the UnknownTopicOrPartitionException.
The pattern seems to be the same:
if (ex.getCause() instanceof UnknownTopicOrPartitionException) {
// send NOT_FOUND
} else {
// send INTERNAL_SERVER_ERROR
}
We should refactor by extracting a common handleAdminError (or similar) to be used across these places.
The
HttpAdminBridgeEndpoint.doGetTopicmethod has multiple places with code duplication when handling theUnknownTopicOrPartitionException.The pattern seems to be the same:
We should refactor by extracting a common
handleAdminError(or similar) to be used across these places.