mirror of
https://github.com/restic/restic.git
synced 2025-08-20 16:47:27 +00:00
Add more error handling
This commit is contained in:
@@ -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