mirror of
https://github.com/restic/restic.git
synced 2025-10-27 12:18:35 +00:00
Let the checker return a list of hints along with errors
This commit is contained in:
@@ -50,8 +50,17 @@ func (cmd CmdCheck) Execute(args []string) error {
|
||||
chkr := checker.New(repo)
|
||||
|
||||
cmd.global.Verbosef("Load indexes\n")
|
||||
if err = chkr.LoadIndex(); err != nil {
|
||||
return err
|
||||
hints, errs := chkr.LoadIndex()
|
||||
|
||||
for _, hint := range hints {
|
||||
cmd.global.Printf("%v\n", hint)
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
for _, err := range errs {
|
||||
cmd.global.Warnf("error: %v\n", err)
|
||||
}
|
||||
return fmt.Errorf("LoadIndex returned errors")
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
|
||||
Reference in New Issue
Block a user