Skip to content

Added improved ExpectedStruct error message#342

Merged
juntyr merged 1 commit into
ron-rs:masterfrom
juntyr:struct-name-error
Nov 30, 2021
Merged

Added improved ExpectedStruct error message#342
juntyr merged 1 commit into
ron-rs:masterfrom
juntyr:struct-name-error

Conversation

@juntyr

@juntyr juntyr commented Nov 19, 2021

Copy link
Copy Markdown
Member

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

@juntyr

juntyr commented Nov 19, 2021

Copy link
Copy Markdown
Member Author

@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.

@torkleyy torkleyy left a comment

Copy link
Copy Markdown
Member

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?

Comment thread src/de/mod.rs

@torkleyy torkleyy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright, LGTM!

@juntyr

juntyr commented Nov 30, 2021

Copy link
Copy Markdown
Member Author

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

juntyr commented Nov 30, 2021

Copy link
Copy Markdown
Member Author

@torkleyy Ready to merge?

@torkleyy torkleyy left a comment

Copy link
Copy Markdown
Member

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.

2 participants