ls: proper error handling if output is not possible

This commit is contained in:
Michael Eischer
2024-11-01 17:05:53 +01:00
parent 569a117a1d
commit d3c3390a51
4 changed files with 70 additions and 60 deletions

View File

@@ -28,7 +28,7 @@ type WalkVisitor struct {
// was returned. This function is mandatory
ProcessNode WalkFunc
// Optional callback
LeaveDir func(path string)
LeaveDir func(path string) error
}
// Walk calls walkFn recursively for each node in root. If walkFn returns an
@@ -100,7 +100,7 @@ func walk(ctx context.Context, repo restic.BlobLoader, prefix string, parentTree
}
if visitor.LeaveDir != nil {
visitor.LeaveDir(prefix)
return visitor.LeaveDir(prefix)
}
return nil