mirror of
https://github.com/restic/restic.git
synced 2025-08-12 17:07:40 +00:00
Merge pull request #2982 from greatroar/archiver-error-handling
Check error in archiver before calling Select
This commit is contained in:
@@ -345,11 +345,6 @@ func (arch *Archiver) Save(ctx context.Context, snPath, target string, previous
|
||||
|
||||
// get file info and run remaining select functions that require file information
|
||||
fi, err := arch.FS.Lstat(target)
|
||||
if !arch.Select(abstarget, fi) {
|
||||
debug.Log("%v is excluded", target)
|
||||
return FutureNode{}, true, nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
debug.Log("lstat() for %v returned error: %v", target, err)
|
||||
err = arch.error(abstarget, fi, err)
|
||||
@@ -358,6 +353,10 @@ func (arch *Archiver) Save(ctx context.Context, snPath, target string, previous
|
||||
}
|
||||
return FutureNode{}, true, nil
|
||||
}
|
||||
if !arch.Select(abstarget, fi) {
|
||||
debug.Log("%v is excluded", target)
|
||||
return FutureNode{}, true, nil
|
||||
}
|
||||
|
||||
switch {
|
||||
case fs.IsRegularFile(fi):
|
||||
|
Reference in New Issue
Block a user