From 8cd4866df7d0e73d9df567a7a627966a41af15dc Mon Sep 17 00:00:00 2001 From: Brian Gann Date: Wed, 10 May 2023 11:14:40 -0400 Subject: [PATCH] Plugins: display plugin id and url when it fails to install (#67336) * display plugin id and url when it fails to install * Update pkg/plugins/repo/client.go Co-authored-by: Giuseppe Guerra --- pkg/plugins/repo/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugins/repo/client.go b/pkg/plugins/repo/client.go index 0d6056d451d62..1588f619754e6 100644 --- a/pkg/plugins/repo/client.go +++ b/pkg/plugins/repo/client.go @@ -53,7 +53,7 @@ func (c *Client) download(_ context.Context, pluginZipURL, checksum string, comp if err := tmpFile.Close(); err != nil { c.log.Warn("Failed to close file", "err", err) } - return nil, fmt.Errorf("%v: %w", "failed to download plugin archive", err) + return nil, fmt.Errorf("%w: failed to download plugin archive (%s)", err, pluginZipURL) } rc, err := zip.OpenReader(tmpFile.Name()) @@ -143,7 +143,7 @@ func (c *Client) downloadFile(tmpFile *os.File, pluginURL, checksum string, comp return fmt.Errorf("failed to write to %q: %w", tmpFile.Name(), err) } if len(checksum) > 0 && checksum != fmt.Sprintf("%x", h.Sum(nil)) { - return fmt.Errorf("expected SHA256 checksum does not match the downloaded archive - please contact security@grafana.com") + return fmt.Errorf("expected SHA256 checksum does not match the downloaded archive (%s) - please contact security@grafana.com", pluginURL) } return nil }