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 emission for ByteUtils.padded #499

Open
sappenin opened this issue Nov 29, 2023 · 0 comments
Open

Improve error emission for ByteUtils.padded #499

sappenin opened this issue Nov 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@sappenin
Copy link
Collaborator

Currently, if one tries to create a UIntType8 (or 16, 32, 64, or anything that ultimately relies on ByteUtils.java) with more than 8 bits (or 2 bytes), then the exception thrown is not helpful. E.g., this code:

new UInt8Type(UnsignedLong.valueOf(500));

yields this exception: java.lang.IllegalArgumentException: invalid count: -1

Instead, the error emission should indicate something about bit legnth. This actually can be handled by improving the error emission in ByteUtils#padded and adding better test coverage, in particular asserting on the error message here.

@sappenin sappenin added the enhancement New feature or request label Nov 29, 2023
@sappenin sappenin mentioned this issue Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant