domainaware / parsedmarc

A Python package and CLI for parsing aggregate and forensic DMARC reports
https://domainaware.github.io/parsedmarc/
Apache License 2.0
981 stars 212 forks source link

Handle unexpected xml parsing errors more gracefully #349

Closed drawks closed 1 year ago

drawks commented 1 year ago
codecov[bot] commented 1 year ago

Codecov Report

Merging #349 (1a793d6) into master (9d739cc) will increase coverage by 0.41%. The diff coverage is 77.77%.

@@            Coverage Diff             @@
##           master     #349      +/-   ##
==========================================
+ Coverage   59.05%   59.46%   +0.41%     
==========================================
  Files           9        9              
  Lines        1309     1315       +6     
==========================================
+ Hits          773      782       +9     
+ Misses        536      533       -3     
Impacted Files Coverage Δ
parsedmarc/__init__.py 61.60% <66.66%> (+0.54%) :arrow_up:
tests.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

drawks commented 1 year ago

Took me a few tries to get through unit tests and codecoverage report. IMHO the tests for this project should be broken down into smaller units. At any rate, this change should catch where the report is empty and handle it as an invalid report instead of raising an uncaught exception.