unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.54k stars 250 forks source link

Fix error handling in Writer #320

Closed gunnsth closed 4 years ago

gunnsth commented 4 years ago

Addresses #316 Introduces a werr parameter such that writes are ignored after the first write error. Finally error is returned. Testcase based on the issue added to check the behavior.


This change is Reviewable

codecov[bot] commented 4 years ago

Codecov Report

Merging #320 into development will increase coverage by 0.00%. The diff coverage is 64.28%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development     #320   +/-   ##
============================================
  Coverage        52.28%   52.29%           
============================================
  Files              235      235           
  Lines            45436    45437    +1     
============================================
+ Hits             23758    23762    +4     
+ Misses           18611    18610    -1     
+ Partials          3067     3065    -2     
Impacted Files Coverage Δ
model/writer.go 75.28% <64.28%> (+0.03%) :arrow_up:
model/page.go 45.04% <0.00%> (+0.58%) :arrow_up:

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 11f3a6e...6308fc8. Read the comment docs.