Create a de::ErrorKind and a kind method to de::Error
Author: adityashah1212Created Jul 14, 2026Updated Jul 14, 2026
The problem with current de::Error is that is throws away the kind information as by default everything boils down to de::Error::custom and in no way forces de::Error implementations to preserve this information. Having this information can help wrapper Deserializers or even wrapping errors to generate more detailed error messages.
But since this information is technically lost, error messages are ambiguous at best in many cases, especially when handling complex scenarios.
I am not sure how we could do this without breaking API to be honest, but a better error exposure is definitely desired.
Source: serde-rs/serde