From fdc7349aa4cad31587f84ea99dbe4000b88d13cb Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 30 Jun 2024 11:42:23 +0200 Subject: [PATCH] check: improve error on damaged index Always return the `repository contains errors` message if a repository is damaged and must be repaired. Also provide specific instructions how to repair the index. --- cmd/restic/cmd_check.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 4cc9c666e..f416c9269 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -274,7 +274,9 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args for _, err := range errs { printer.E("error: %v\n", err) } - return errors.Fatal("LoadIndex returned errors") + + printer.E("\nThe repository index is damaged and must be repaired. You must run `restic repair index' to correct this.\n\n") + return errors.Fatal("repository contains errors") } orphanedPacks := 0