json
json copied to clipboard
How to get message back out of `Error`
I'm wondering how you're supposed to do error handling using serde_json?
Custom error messages get turned into plain strings inside the Error::Message()
struct which makes them unmatchable. There also doesn't seem a way to get access to Error::Message
at all so it would seem someone would have to rely on the output of fmt::Display
, which sometimes modifies the string as "{} at line {} column {}"
so you'd have to split the string on some plain text.