Skip to content

Omit line number for toml parse error for unknown spans #2192

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bim9262
Copy link
Collaborator

@bim9262 bim9262 commented Aug 19, 2025

In the case that the span is (0..0), we don't usually know where the error really occurred. In that case just omit the line number.

Of course the error really could be at the start of the file, but the error unknown field XXX should be easy enough to find and is less misleading than saying the error is on line 1, when it's not really.

Resolves: #2189

This error is tracked upstream:

In the case that the span is (0..0), we don't usually know where the
error really occurred. In that case just omit the line number.

Resolves: greshake#2189

This error is tracked upstream:

* toml: toml-rs/toml#589
* serde: serde-rs/serde#1183
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.

Erronous "Failed to deserialize TOML file at line 1: unknown field sound"
1 participant