ebarnard / rust-plist

A rusty plist parser.
MIT License
71 stars 42 forks source link

Outside access to `Error.inner.file_position`? #60

Closed madig closed 3 years ago

madig commented 3 years ago

I'd like to wrap plist errors and display filename and position to the user. I can add the filename myself at a higher layer, but how do I access Error.inner.file_position from outside the crate? Should plist instead display the information via impl fmt::Display for Error? I could send a PR.

ebarnard commented 3 years ago

It would certainly be useful to display the error position in the formatted error message.

The byte position (if one exists) could also be exposed as a method on Error. I'm more hesitent to expose the line and column in a method as not all xml libraries return that information.

madig commented 3 years ago

Hm yes, I think displaying the position information in the formatted error message should be enough for now. Can cook up a PR when I get some time.

ebarnard commented 3 years ago

Great.