Chore: Remove plugincontext.ErrPluginNotFound (#74997)

This commit is contained in:
Andres Martinez Gotor
2023-09-25 12:10:47 +02:00
committed by GitHub
parent 1714fa598c
commit ece94b1e01
9 changed files with 18 additions and 32 deletions

View File

@ -26,7 +26,6 @@ import (
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginaccesscontrol"
"github.com/grafana/grafana/pkg/services/pluginsintegration/plugincontext"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginsettings"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
"github.com/grafana/grafana/pkg/setting"
@ -394,10 +393,7 @@ func (hs *HTTPServer) CheckHealth(c *contextmodel.ReqContext) response.Response
pluginID := web.Params(c.Req)[":pluginId"]
pCtx, err := hs.pluginContextProvider.Get(c.Req.Context(), pluginID, c.SignedInUser, c.OrgID)
if err != nil {
if errors.Is(err, plugincontext.ErrPluginNotFound) {
return response.Error(http.StatusNotFound, "Plugin not found", nil)
}
return response.Error(http.StatusInternalServerError, "Failed to get plugin settings", err)
return response.ErrOrFallback(http.StatusInternalServerError, "Failed to get plugin settings", err)
}
resp, err := hs.pluginClient.CheckHealth(c.Req.Context(), &backend.CheckHealthRequest{
PluginContext: pCtx,