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

Wrap errors in a new struct type and report parsing-failure positions #127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

apasel422
Copy link
Collaborator

@apasel422 apasel422 commented Feb 14, 2025

Fixes #126

@apasel422 apasel422 marked this pull request as ready for review February 14, 2025 13:06
@apasel422 apasel422 requested a review from valenting February 14, 2025 13:26
Copy link
Collaborator

@valenting valenting left a comment

Choose a reason for hiding this comment

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

I'm not against this change, but it would be nice to see it land together with something that actually uses it.

@apasel422
Copy link
Collaborator Author

I'm not against this change, but it would be nice to see it land together with something that actually uses it.

I can certainly update this PR in place with error positions, if you'd prefer not to merge it in isolation.

@apasel422 apasel422 marked this pull request as draft February 20, 2025 13:42
@apasel422 apasel422 requested a review from valenting February 20, 2025 15:17
@apasel422 apasel422 marked this pull request as ready for review February 20, 2025 15:17
@apasel422 apasel422 changed the title Wrap errors in a new struct type Wrap errors in a new struct type and report parsing-failure positions Feb 20, 2025
@apasel422 apasel422 marked this pull request as draft February 20, 2025 17:19
@apasel422 apasel422 removed the request for review from valenting February 20, 2025 17:19
@valenting
Copy link
Collaborator

I can certainly update this PR in place with error positions, if you'd prefer not to merge it in isolation.

Also consider whether we really need error positions. It would be nice to have, sure, but I'd like to see a use case that actually requires it.

This will make it easier to provide additional information, such as the
position at which parsing failed.
@apasel422 apasel422 marked this pull request as ready for review February 21, 2025 13:24
@apasel422 apasel422 requested a review from valenting February 21, 2025 13:24
@apasel422
Copy link
Collaborator Author

It would be nice to have, sure, but I'd like to see a use case that actually requires it.

In my opinion the use case is better debugging, probably mostly for code sending structured values.

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.

Replace static string error types with a wrapper
2 participants