Commit 0e4e7ec
authored
datastore: fix WithIgnoreFieldMismatch for nested slices (#13799)
Fixes: #10822
This change ensures that propertyLoader.load continues iterating through
slice elements even if individual elements encounter loading errors
(like ErrFieldMismatch).
Previously, when loading a slice of structs, if one element caused an
error (e.g. valid field mismatch), the loader would abort immediately.
This prevented subsequent elements from being loaded, even if the user
intended to ignore these mismatches using WithIgnoreFieldMismatch.
The fix captures the first error encountered but continues the loop to
ensure all valid data is loaded. The error is returned at the end,
preserving the existing error reporting behavior (which
WithIgnoreFieldMismatch relies on).1 parent 892c5d3 commit 0e4e7ec
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | | - | |
| 90 | + | |
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| |||
0 commit comments