From c2aabb268624632149e58f87d07f86ac0d66a8d6 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 9 Apr 2022 22:22:40 +0200 Subject: [PATCH] Print used key name if config fails to load --- internal/repository/repository.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/repository/repository.go b/internal/repository/repository.go index 32583ad15..d74868895 100644 --- a/internal/repository/repository.go +++ b/internal/repository/repository.go @@ -593,7 +593,9 @@ func (r *Repository) SearchKey(ctx context.Context, password string, maxKeys int r.treePM.key = key.master r.keyName = key.Name() r.cfg, err = restic.LoadConfig(ctx, r) - if err != nil { + if err == crypto.ErrUnauthenticated { + return errors.Fatalf("config or key %v is damaged: %v", key.Name(), err) + } else if err != nil { return errors.Fatalf("config cannot be loaded: %v", err) } return nil