Skip to content

Factoring out a common error handler method for UnknownTopicOrPartitionException within the HttpAdminBridgeEndpoint #1114

Description

@ppatierno

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions