Fix: cli error message when installing plugin doesn't include helpful… (#32467)

* Fix: cli error message when installing plugin doesn't include helpful info

* Update pkg/cmd/grafana-cli/services/api_client.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
ying-jeanne 2021-03-30 10:58:08 +02:00 committed by GitHub
parent 2c72f8babc
commit 3b087db6ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,8 @@ func (client *GrafanaComClient) GetPlugin(pluginId, repoUrl string) (models.Plug
body, err := sendRequestGetBytes(HttpClient, repoUrl, "repo", pluginId)
if err != nil {
if errors.Is(err, ErrNotFoundError) {
return models.Plugin{}, errutil.Wrap("Failed to find requested plugin, check if the plugin_id is correct", err)
return models.Plugin{}, errutil.Wrap(
fmt.Sprintf("Failed to find requested plugin, check if the plugin_id (%s) is correct", pluginId), err)
}
return models.Plugin{}, errutil.Wrap("Failed to send request", err)
}