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

Error Location similar to Serde JSON or TOML Spanned? #625

Open
EthanJamesLew opened this issue Jul 25, 2023 · 1 comment
Open

Error Location similar to Serde JSON or TOML Spanned? #625

EthanJamesLew opened this issue Jul 25, 2023 · 1 comment
Labels
enhancement help wanted serde Issues related to mapping from Rust types to XML

Comments

@EthanJamesLew
Copy link

EthanJamesLew commented Jul 25, 2023

Hi!

First of all, thank you for your excellent work on the quick-xml project!

I'm currently working on a project where accurate error reporting would be nice. Particularly, I would like to be able to report the line and column number of any deserialization errors that occur when parsing an XML document. From what I understand, quick-xml does not support this feature directly.

However, having a similar mechanism to what serde_json and serde_toml offer, in terms of Spanned, would be great for more precise error reporting, even at the cost of some performance overheads.

Please consider this feature for future versions of quick-xml. If there is anything I can do to help (testing, design, etc.), I would be interested in contributing.

Thanks!

@EthanJamesLew EthanJamesLew changed the title Error Location similar to Serde's JSON or TOML SpannedDeserializer? Error Location similar to Serde JSON or TOML SpannedDeserializer? Jul 25, 2023
@EthanJamesLew EthanJamesLew changed the title Error Location similar to Serde JSON or TOML SpannedDeserializer? Error Location similar to Serde JSON or TOML Spanned? Jul 25, 2023
@Mingun
Copy link
Collaborator

Mingun commented Jul 25, 2023

I have a proposal of spans in events in my branch (some tests a failed now), but it is not yet integrated to the error type (I also have a feeling that we should rework our errors). Feel free to take over the baton if you will.

I've also prototyping a serde integration on top of this that allows me to deserialize a special type with span information given by deserializer, but that requires changes in serde.

Also, some related ideas discussed in #109.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

No branches or pull requests

2 participants