linebender / norad

Rust crate for working with Unified Font Object files
Apache License 2.0
43 stars 12 forks source link

Plist deserialization: investigate better error reporting #196

Open madig opened 3 years ago

madig commented 3 years ago

I just had someone edit a contents.plist file and forgetting to delete the <value> and the <key>. The returned error was

UnexpectedEventType { expected: ValueOrStartCollection, found: EndCollection }

Not very helpful. norad should take care to bubble up the file in question and ideally the location of the 💥.

madig commented 2 years ago

We now have an error chain so at least we know which file blows up. Line information in quick_xml and plist seems harder to come by?

madig commented 2 years ago

I don't think we can do something for a v1.0? Eventually we need to take our found plist problems upstream or make a custom plist handler.

cmyr commented 2 years ago

I think as long as this is just about how errors are represented/printed it's okay to worry about after 1.0. :)

madig commented 2 years ago

I think it is, or at least I hope so. If we implement our own plist parser crate (on top tof quick_xml), we need to change the publicly exposed error types, though. That's a vague "if" though. Taking this off of 1.0 for now, there's no shame in a 2.0 :)