Add debug message on unmarshal errors (#3153)

This commit is contained in:
guangwu 2023-04-21 21:12:02 +08:00 committed by GitHub
parent 117611a170
commit 489d69f779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -881,6 +881,9 @@ func (u *Unmarshaler) unmarshalWithFullName(m valuerWithParent, v any, fullName
typeField := baseType.Field(i)
valueField := valElem.Field(i)
if err := u.processField(typeField, valueField, m, fullName); err != nil {
if fullName != "" {
err = fmt.Errorf("%s, fullName :%s, typeField :%s, valueField :%s", err.Error(), fullName, typeField.Name, valueField.Type())
}
return err
}
}