1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-25 09:18:55 +00:00

Merge pull request #3702 from MichaelEischer/extend-config-error

Print used key name if config fails to load
This commit is contained in:
Alexander Neumann 2022-04-10 20:25:24 +02:00 committed by GitHub
commit a059ef90f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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