From 9dfbecc61126a18b77ff52ef4c2e6e3e39da22a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Toledano?= Date: Mon, 27 Nov 2023 13:08:53 +0100 Subject: [PATCH] fix(client/keys): don't return when key not found in keys delete (#18562) --- client/keys/delete.go | 3 ++- client/keys/delete_test.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/keys/delete.go b/client/keys/delete.go index b9e182a4c6..532e14edd0 100644 --- a/client/keys/delete.go +++ b/client/keys/delete.go @@ -37,7 +37,8 @@ private keys stored in a ledger device cannot be deleted with the CLI. for _, name := range args { info, err := clientCtx.Keyring.Key(name) if err != nil { - return err + cmd.PrintErrf("key %s not found\n", name) + continue } // confirm deletion, unless -y is passed diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index afb1c0fb0f..2a4bf397fd 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -51,8 +51,7 @@ func Test_runDeleteCmd(t *testing.T) { ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) err = cmd.ExecuteContext(ctx) - require.Error(t, err) - require.EqualError(t, err, "blah.info: key not found") + require.NoError(t, err) // User confirmation missing cmd.SetArgs([]string{