We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A field that returns a serde deserialize error will always have the field set to None.
field
None
impl SerdeError for DeserializeError { fn custom<T: fmt::Display>(msg: T) -> DeserializeError { DeserializeError { field: None, kind: DEK::Message(msg.to_string()) } } }
It does not appear we can determine the field that failed to deserialize from serde to report to the user.
One option is to modify the deserialize_string_record function to manually set the err.field in the map_err closure
deserialize_string_record
err.field
map_err
D::deserialize(&mut deser).map_err(|mut err| { err.set_field(Some(deser.0.field.saturating_sub(1)); Error::new(ErrorKind::Deserialize { pos: record.position().map(Clone::clone), err, }) })
I am unsure if this is a valid solution or if there are edge cases that will cause the field index to not be accurate.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
A field that returns a serde deserialize error will always have the
field
set toNone
.It does not appear we can determine the field that failed to deserialize from serde to report to the user.
One option is to modify the
deserialize_string_record
function to manually set theerr.field
in themap_err
closureI am unsure if this is a valid solution or if there are edge cases that will cause the field index to not be accurate.
The text was updated successfully, but these errors were encountered: