File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -216,23 +216,24 @@ func MakeBackupDestinationStores(
216
216
mkStore cloud.ExternalStorageFromURIFactory ,
217
217
destinationDirs []string ,
218
218
) ([]cloud.ExternalStorage , func () error , error ) {
219
- incStores := make ([]cloud.ExternalStorage , len (destinationDirs ))
219
+ stores := make ([]cloud.ExternalStorage , len (destinationDirs ))
220
220
for i := range destinationDirs {
221
221
store , err := mkStore (ctx , destinationDirs [i ], user )
222
222
if err != nil {
223
223
return nil , nil , errors .Wrapf (err , "failed to open backup storage location" )
224
224
}
225
- incStores [i ] = store
225
+ stores [i ] = store
226
226
}
227
227
228
- return incStores , func () error {
229
- // Close all the incremental stores in the returned cleanup function.
230
- for _ , store := range incStores {
228
+ return stores , func () error {
229
+ // Close all the stores in the returned cleanup function.
230
+ var combinedErr error
231
+ for _ , store := range stores {
231
232
if err := store .Close (); err != nil {
232
- return err
233
+ combinedErr = errors . CombineErrors ( combinedErr , err )
233
234
}
234
235
}
235
- return nil
236
+ return combinedErr
236
237
}, nil
237
238
}
238
239
You can’t perform that action at this time.
0 commit comments