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

Improve error outputs for Python code #1556

Merged
merged 1 commit into from
May 25, 2023

Conversation

heinrich5991
Copy link
Contributor

Fixes #1555.

Before:

>>> libtw2_huffman.decompress(b"")
Traceback (most recent call last):
[…]
libtw2_huffman.UniFFIExceptionTmpNamespace.InvalidInput: DecompressionError.InvalidInput('input is not a valid huffman compression')

After:

>>> libtw2_huffman.decompress(b"")
Traceback (most recent call last):
[…]
libtw2_huffman.DecompressionError.InvalidInput: input is not a valid huffman compression

@heinrich5991 heinrich5991 requested a review from a team as a code owner May 24, 2023 11:17
@heinrich5991 heinrich5991 requested review from badboy and removed request for a team May 24, 2023 11:17
@bendk
Copy link
Contributor

bendk commented May 24, 2023

Thank you for giving this a pass. I'm not sure what the final product should be, but I don't think the current code is correct and I'm glad someone is pushing for changes.

@heinrich5991 heinrich5991 force-pushed the pr_py_error_names branch 3 times, most recently from a4f2f7b to 5a91b36 Compare May 24, 2023 15:56
Fixes mozilla#1555.

Before:
```
>>> libtw2_huffman.decompress(b"")
Traceback (most recent call last):
[…]
libtw2_huffman.UniFFIExceptionTmpNamespace.InvalidInput: DecompressionError.InvalidInput('input is not a valid huffman compression')
```

After:
```
>>> libtw2_huffman.decompress(b"")
Traceback (most recent call last):
[…]
libtw2_huffman.DecompressionError.InvalidInput: input is not a valid huffman compression
```
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for this.

@bendk bendk merged commit c928baf into mozilla:main May 25, 2023
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 messages in Python are verbose
2 participants