From 1752918878aca0f5f811263be091cdd17a26562a Mon Sep 17 00:00:00 2001 From: Junjie Gao Date: Tue, 30 Jan 2024 01:01:16 +0800 Subject: [PATCH] fix: update error message (#380) Previous: ``` Error: describe-key command failed: failed to execute the describe-key command for plugin azure-kv: CertificateNotFound: A certificate with (name/id) self-signed-pkcs13/versions/70747b2064c0488e936eba7a29acc4c6 was not found in this key vault. If you recently deleted this certificate you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182 ``` Current: ``` Error: failed to execute the describe-key command for plugin azure-kv: CertificateNotFound: A certificate with (name/id) self-signed-pkcs13/versions/70747b2064c0488e936eba7a29acc4c6 was not found in this key vault. If you recently deleted this certificate you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182 ``` Signed-off-by: Junjie Gao --- signer/plugin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/signer/plugin.go b/signer/plugin.go index 139f354e..b4ca5dbc 100644 --- a/signer/plugin.go +++ b/signer/plugin.go @@ -200,7 +200,7 @@ func (s *pluginSigner) describeKey(ctx context.Context, config map[string]string } resp, err := s.plugin.DescribeKey(ctx, req) if err != nil { - return nil, fmt.Errorf("describe-key command failed: %w", err) + return nil, err } return resp, nil @@ -301,7 +301,7 @@ func (s *pluginPrimitiveSigner) Sign(payload []byte) ([]byte, []*x509.Certificat resp, err := s.plugin.GenerateSignature(s.ctx, req) if err != nil { - return nil, nil, fmt.Errorf("generate-signature command failed: %w", err) + return nil, nil, err } // Check keyID is honored.