xsdata
xsdata copied to clipboard
Make warnings more informative by including the class being parsed
Current converter warnings only include the token and the types it is being matched to. This makes it hard to narrow down what exactly they refer to without stepping up the frames in the debugger (and not very useful if the only thing you have is a warning in a log).
This PR adds a wrapper that catches and re-emits the converter warnings after adding field and class names to the warning message.
Kudos, SonarCloud Quality Gate passed!
0 Bugs
0 Vulnerabilities
0 Security Hotspots
1 Code Smell
No Coverage information
0.0% Duplication
This needs to be applied pretty much in all the converter interactions, not just the xml and for attributes, I like the idea a lot!
Codecov Report
Merging #608 (a7deda8) into master (1c8ad86) will decrease coverage by
0.11%
. The diff coverage is55.00%
.
@@ Coverage Diff @@
## master #608 +/- ##
===========================================
- Coverage 100.00% 99.88% -0.12%
===========================================
Files 94 95 +1
Lines 8122 8139 +17
Branches 1410 1415 +5
===========================================
+ Hits 8122 8130 +8
- Misses 0 6 +6
- Partials 0 3 +3
Impacted Files | Coverage Δ | |
---|---|---|
xsdata/utils/warning_transform.py | 50.00% <50.00%> (ø) |
|
xsdata/formats/dataclass/parsers/nodes/element.py | 99.51% <75.00%> (-0.49%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 1c8ad86...a7deda8. Read the comment docs.
Let's keep open, so I don't forget I really want to do this the right way
This would have been really useful in diagnosing a recent bug!
Closing for now, please open an issue