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

Replace *errors.errorString with InadmissibleTagContentTypeError #552

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

fxamacker
Copy link
Owner

Closes #551

Currently *errors.errorString is returned when unmarshalling built-in tags (tag 0-3 and 21-23) with inadmissible content type.

This PR adds InadmissibleTagContentTypeError and returns it (instead of *errors.errorString) for inadmissible type for tag content.

For compatibility, InadmisibleTagContentTypeError returns the same error message as before when unmarshalling build-in tags with inadmissible content type.

See "Tag validity" in RFC 8949 Section 5.3.2 for more about "inadmissible type for tag content".

@fxamacker fxamacker added the improvement improvement that does not add new feature label Jun 9, 2024
@fxamacker fxamacker self-assigned this Jun 9, 2024
Currently *errors.errorString is returned when unmarshalling
built-in tags (tag 0-3 and 21-23) with inadmissible content type.

This commit adds InadmissibleTagContentTypeError and returns this
error with the same error message as before when unmarshalling
build-in tags with inadmissible content type.
@fxamacker fxamacker force-pushed the fxamacker/add-InadmissibleTagContentTypeError branch from 752db06 to b84b471 Compare June 9, 2024 22:11
@fxamacker
Copy link
Owner Author

@benluddy @x448 PTAL 🙏

Copy link
Contributor

@x448 x448 left a comment

Choose a reason for hiding this comment

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

Good idea to use same error message for compatibility. You can add tests to show that the new error strings match old error strings.

@fxamacker fxamacker changed the base branch from fxamacker/improve-bytestringformat-dec-mode to master June 10, 2024 00:22
@fxamacker fxamacker merged commit 1816328 into master Jun 10, 2024
18 checks passed
@fxamacker fxamacker deleted the fxamacker/add-InadmissibleTagContentTypeError branch September 7, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improvement that does not add new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace *errors.errorString with more specific error type for "inadmissible type for tag content"
2 participants