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

Added improved ExpectedStruct error message #342

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

juntyr
Copy link
Member

@juntyr juntyr commented Nov 19, 2021

Improves the error messages for ExpectedStruct (now ExpectedNamedStruct), NoSuchExtension, and UnexpectedByte by including the erroneous identifier in the message. This small change should help with #301.

  • I've included my change in CHANGELOG.md

Sorry, something went wrong.

@juntyr
Copy link
Member Author

juntyr commented Nov 19, 2021

@torkleyy In relation to #301 (comment) I did some small experimentation to ever so slightly improve the error message from Expected struct to Expected struct 'MyStruct' when the struct name is known. This would already help the case when an error message is confusing but doesn't require the complex changes that would be needed to see e.g. if a different struct name was given.

Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

Great quality of life improvement! Can we always include the struct name in the error?

Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

Alright, LGTM!

@juntyr
Copy link
Member Author

juntyr commented Nov 30, 2021

Alright, LGTM!

Ok, I'll add the Changelog entry and merge it later today :)

@juntyr juntyr marked this pull request as ready for review November 30, 2021 13:08
@juntyr
Copy link
Member Author

juntyr commented Nov 30, 2021

@torkleyy Ready to merge?

Copy link
Contributor

@torkleyy torkleyy left a comment

Choose a reason for hiding this comment

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

:shipit:

@juntyr juntyr merged commit 259cd2f into ron-rs:master Nov 30, 2021
@juntyr juntyr deleted the struct-name-error branch November 30, 2021 14:05
torkleyy pushed a commit to torkleyy/ron that referenced this pull request Jun 6, 2022
Added improved `ExpectedStruct` error message
@torkleyy torkleyy mentioned this pull request Jun 6, 2022
2 tasks
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.

None yet

2 participants