whikloj / BagItTools

A PHP BagIt library
MIT License
11 stars 5 forks source link

Check for issues with file operations and throw exception on errors #20

Closed whikloj closed 4 years ago

whikloj commented 4 years ago

Resolves #19

This PR adds a new exception FilesystemException which is related to errors with filesystem operations. It is a sub-class of the existing BagItException so it should not require changes to existing exception handling.

codecov[bot] commented 4 years ago

Codecov Report

Merging #20 into main will increase coverage by 1.42%. The diff coverage is 54.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #20      +/-   ##
============================================
+ Coverage     79.71%   81.13%   +1.42%     
  Complexity      482      482              
============================================
  Files             7        7              
  Lines          1267     1283      +16     
============================================
+ Hits           1010     1041      +31     
+ Misses          257      242      -15     
Impacted Files Coverage Δ Complexity Δ
src/Bag.php 78.98% <38.46%> (-0.14%) 276.00 <0.00> (-5.00)
src/AbstractManifest.php 81.10% <40.00%> (-0.50%) 44.00 <0.00> (+1.00) :arrow_down:
src/BagUtils.php 90.24% <68.00%> (-8.07%) 41.00 <12.00> (+11.00) :arrow_down:
src/Fetch.php 82.37% <70.00%> (+8.90%) 91.00 <0.00> (-3.00) :arrow_up:
src/TagManifest.php 84.00% <0.00%> (-1.72%) 8.00% <0.00%> (-3.00%)
src/PayloadManifest.php 100.00% <0.00%> (ø) 5.00% <0.00%> (-1.00%)
src/Commands/ValidateCommand.php 87.50% <0.00%> (+5.00%) 17.00% <0.00%> (ø%)

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 34510bb...4b8b30d. Read the comment docs.

whikloj commented 4 years ago

@henning-gerhardt Thoughts on this approach? I think this covers your concerns but wanted to make sure.

henning-gerhardt commented 4 years ago

Looks good for me but I did not check every single line of code for proving that all possible methods are checked.

whikloj commented 4 years ago

Fair enough, I think I got them all but I'll keep an eye out in future.