Commit 4048702
authored
Improve missing field errors (#747)
Missing required fields currently surface as a bare
`SerdeError("'field'")`.
Here we catch that `KeyError` at the required-field lookup site so
pyserde raises a contextual `SerdeError` with the field and class name,
while leaving defaulted-field fallback behavior unchanged.1 parent ec3cd05 commit 4048702
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
| 1291 | + | |
1291 | 1292 | | |
1292 | 1293 | | |
| 1294 | + | |
| 1295 | + | |
1293 | 1296 | | |
1294 | | - | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1295 | 1303 | | |
1296 | 1304 | | |
1297 | 1305 | | |
| |||
1503 | 1511 | | |
1504 | 1512 | | |
1505 | 1513 | | |
| 1514 | + | |
1506 | 1515 | | |
1507 | 1516 | | |
1508 | 1517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
| 997 | + | |
998 | 998 | | |
999 | 999 | | |
| 1000 | + | |
| 1001 | + | |
1000 | 1002 | | |
1001 | 1003 | | |
1002 | 1004 | | |
| |||
0 commit comments