Open
Description
Currently, it is annoying to track error.position
in every function returning der::Error
.
From another issue:
Attempting to even construct der::Error was confusing [...] It is also unclear to me whether the position that this method uses will be correct [...]
Lines 23 to 24 in 9813667
Actually, most functions don't return the position - example:
Lines 79 to 83 in 9813667
What I suggest is something like serde + quick-xml:
let mut reader = SliceReader::new(EXAMPLE_MSG).unwrap();
let err = SomeStruct::decode(&mut reader);
assert!(err.is_err());
assert_eq!(reader.error_position(), 28);
https://docs.rs/quick-xml/latest/quick_xml/de/struct.Deserializer.html#method.get_ref
Metadata
Metadata
Assignees
Labels
No labels