Skip to content

Conversation

@JosRoseboom
Copy link

This pr contains 2 commits that provide a solution for the 2 problems described in #1072

…elpful to use the reason String that came in as an parameter than UNKNOWN_ERROR. UNKNOWN_ERROR could be used for null or empty Strings.
@google-cla
Copy link

google-cla bot commented Feb 5, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@JosRoseboom JosRoseboom changed the title Issue 1072 Issue 1072: Error codes in TopicManagementResponse are incomplete, causing loss of important debug information Feb 5, 2025
Copy link
Contributor

@jonathanedey jonathanedey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JosRoseboom for putting this together! These changes look good with one comment.

if (reason == null || reason.trim().isEmpty()) {
this.reason = UNKNOWN_ERROR;
} else {
this.reason = ERROR_CODES.getOrDefault(reason, reason);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that unknown-error isn't very helpful here and in the future we want to avoid needlessly abstracting information like this. This is a reasonable stop gap until we can address this fully in a breaking change.

For consistency with the current format of the error reasons, could you add some additional logic here to map them from UPPER_SNAKE_CASE to lower-kebab-case.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error codes in TopicManagementResponse are incomplete, causing loss of important debug information

3 participants