extractor: Close files even when writes fail

This commit is contained in:
Sauyon Lee
2020-03-10 00:52:25 -07:00
parent cdf3bc4fa0
commit 79ab831776

View File

@@ -72,6 +72,8 @@ func trapFolder() (string, error) {
func (tw *Writer) Close() error {
err := tw.w.Flush()
if err != nil {
// throw away close error because write errors are likely to be more important
tw.file.Close()
return err
}
err = tw.file.Close()