Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed how wrapped KsqlTopicAuthorizationException error messages are displayed #3258

Conversation

stevenpyzhang
Copy link
Member

Description

When the command fails due to TopicAuthorizationException for InsertInto, a KsqlAuthorizationException is wrapped with a KsqlException

ksql> INSERT INTO TESTSTREAM (ROWTIME, ROWKEY, age) VALUES ( 1234, 'KEY', 4);
Failed to insert values into stream/table: TESTSTREAM

This is missing a Caused by: second line in the error message. This was due to the function
accessDeniedFromKafka only using the message of the top level exception passed into it instead of the entire exception. Updated the function to match the badRequest function (Caused by: will now show up)

ksql> INSERT INTO TESTSTREAM (ROWTIME, ROWKEY, age) VALUES ( 1234, 'KEY', 4);
Failed to insert values into stream/table: TESTSTREAM
Caused by: Authorization denied to Write on topic(s): [qwerqwerqwerqwerqtly]

Testing done

unit test
Local testing

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@stevenpyzhang stevenpyzhang requested a review from a team as a code owner August 22, 2019 22:30
Copy link
Member

@spena spena left a comment

Choose a reason for hiding this comment

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

LGTM

@stevenpyzhang stevenpyzhang force-pushed the bug-wrapped-auth-exception-response branch from fc893d7 to da0d7c1 Compare August 22, 2019 23:28
@stevenpyzhang stevenpyzhang merged commit 63672ae into confluentinc:master Aug 23, 2019
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.

2 participants