mirror of
https://github.com/restic/restic.git
synced 2026-10-13 05:27:13 +00:00
Add more error handling
This commit is contained in:
1 parent
aef3658a5f
commit
0858fbf6aa
23 files changed
+91
-36
No files matched your search
@@ -23,10 +23,16 @@ func readZipFile(f *zip.File) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rc.Close()
|
||||
|
||||
b := &bytes.Buffer{}
|
||||
_, err = b.ReadFrom(rc)
|
||||
if err != nil {
|
||||
// ignore subsequent errors
|
||||
_ = rc.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = rc.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user