mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Refactor backend plugin errors (#74928)
This commit is contained in:
committed by
GitHub
parent
38d2357bb8
commit
1714fa598c
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
@@ -30,7 +30,7 @@ func (hs *HTTPServer) pluginMetricsEndpoint(ctx *web.Context) {
|
||||
|
||||
resp, err := hs.pluginClient.CollectMetrics(ctx.Req.Context(), &backend.CollectMetricsRequest{PluginContext: backend.PluginContext{PluginID: pluginID}})
|
||||
if err != nil {
|
||||
if errors.Is(err, backendplugin.ErrPluginNotRegistered) {
|
||||
if errors.Is(err, plugins.ErrPluginNotRegistered) {
|
||||
ctx.Resp.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user