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

Handling of struct errors doesn't print the specific error message #1318

Closed
jeffwidman opened this issue Dec 8, 2017 · 0 comments
Closed

Comments

@jeffwidman
Copy link
Collaborator

jeffwidman commented Dec 8, 2017

When a struct.error is thrown during _pack() or _unpack(), we catch and re-raise as a ValueError: https://github.com/dpkp/kafka-python/blob/master/kafka/protocol/types.py#L11-L12

However, we're shadowing the word error so we lose a handle on the specific exception and cannot print the specific error message.

jeffwidman added a commit that referenced this issue Dec 8, 2017
Stop shadowing the word `error` because we want to know what the specific exception message was.

Also give more details on exactly which value failed. We don't know who submitted the value, but perhaps it's unique enough that we can debug it better.

Fix #1318
jeffwidman added a commit that referenced this issue Dec 8, 2017
Stop shadowing the word `error` because we want to know what the
specific exception message was.

Also give more details on exactly which value failed. We don't know who
submitted the value, but perhaps it's unique enough that we can debug it better.

Fix #1318
jeffwidman added a commit that referenced this issue Dec 8, 2017
Stop shadowing the word `error` because we want to know what the
specific exception message was.

Also give more details on exactly which value failed. We don't know who
submitted the value, but perhaps it's unique enough that we can debug it better.

Fix #1318
@jeffwidman jeffwidman changed the title Handling of struct errors seems uneccessarily confusing and complex Handling of struct errors doesn't print the specific error message Dec 8, 2017
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

No branches or pull requests

1 participant