xsdata icon indicating copy to clipboard operation
xsdata copied to clipboard

Make warnings more informative by including the class being parsed

Open Belinsky-L-V opened this issue 2 years ago • 5 comments

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.

Belinsky-L-V avatar Nov 09 '21 09:11 Belinsky-L-V

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarcloud[bot] avatar Nov 09 '21 09:11 sonarcloud[bot]

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!

tefra avatar Nov 09 '21 17:11 tefra

Codecov Report

Merging #608 (a7deda8) into master (1c8ad86) will decrease coverage by 0.11%. The diff coverage is 55.00%.

Impacted file tree graph

@@             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.

codecov[bot] avatar Nov 09 '21 17:11 codecov[bot]

Let's keep open, so I don't forget I really want to do this the right way

tefra avatar Jul 16 '23 16:07 tefra

This would have been really useful in diagnosing a recent bug!

loopj avatar Aug 31 '23 00:08 loopj

Closing for now, please open an issue

tefra avatar Mar 09 '24 18:03 tefra