dn-m / MusicXML

Implementation of the musicXML specification in Swift
MIT License
70 stars 19 forks source link

Specify Ornament error #127

Closed bwetherfield closed 4 years ago

bwetherfield commented 4 years ago

Wondering if this pattern is more in line with your thinking, @DJBen. If this is valid, perhaps we could use this throwing structure for other choice elements, so that we are not consistently rethrowing the typeMismatch error of whatever case is the last in the do-catch pyramid. @jsbean

jsbean commented 4 years ago

While you're touching that code, you wanna convert it into the container.contains(key) style 😅 ?

bwetherfield commented 4 years ago

aaaah yes!

codecov-io commented 4 years ago

Codecov Report

Merging #127 into latest will decrease coverage by 0.31%. The diff coverage is 78.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           latest     #127      +/-   ##
==========================================
- Coverage   57.67%   57.36%   -0.32%     
==========================================
  Files         218      218              
  Lines        2800     2798       -2     
==========================================
- Hits         1615     1605      -10     
- Misses       1185     1193       +8
Impacted Files Coverage Δ
Sources/MusicXML/Complex Types/Ornaments.swift 100% <100%> (ø) :arrow_up:
Sources/MusicXML/Complex Types/Ornament.swift 46.96% <77.41%> (-13.33%) :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 9ec7650...b0a7242. Read the comment docs.

bwetherfield commented 4 years ago

OK, I have made another change to mirror other choice decoding in the codebase (including error handling)