mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 03:32:20 +08:00
Chore: Refactor backend plugin errors (#74928)
This commit is contained in:

committed by
GitHub

parent
38d2357bb8
commit
1714fa598c
@ -3,16 +3,24 @@ package plugins
|
||||
import "github.com/grafana/grafana/pkg/util/errutil"
|
||||
|
||||
var (
|
||||
errPluginNotRegisteredBase = errutil.NotFound("plugin.notRegistered",
|
||||
errutil.WithPublicMessage("Plugin not registered"))
|
||||
// ErrPluginNotRegistered error returned when a plugin is not registered.
|
||||
ErrPluginNotRegistered = errutil.NotFound("plugin.notRegistered")
|
||||
// ErrHealthCheckFailed error returned when a plugin health check failed.
|
||||
ErrHealthCheckFailed = errutil.Internal("plugin.failedHealthCheck")
|
||||
ErrPluginNotRegistered = errPluginNotRegisteredBase.Errorf("plugin not registered")
|
||||
|
||||
errPluginUnavailableBase = errutil.Internal("plugin.unavailable",
|
||||
errutil.WithPublicMessage("Plugin unavailable"))
|
||||
// ErrPluginUnavailable error returned when a plugin is unavailable.
|
||||
ErrPluginUnavailable = errutil.Internal("plugin.unavailable")
|
||||
ErrPluginUnavailable = errPluginUnavailableBase.Errorf("plugin unavailable")
|
||||
|
||||
errMethodNotImplementedBase = errutil.NotFound("plugin.notImplemented",
|
||||
errutil.WithPublicMessage("Method not implemented"))
|
||||
// ErrMethodNotImplemented error returned when a plugin method is not implemented.
|
||||
ErrMethodNotImplemented = errutil.NotImplemented("plugin.notImplemented")
|
||||
ErrMethodNotImplemented = errMethodNotImplementedBase.Errorf("method not implemented")
|
||||
|
||||
// ErrPluginDownstreamError error returned when a plugin request fails.
|
||||
ErrPluginDownstreamError = errutil.Internal("plugin.downstreamError",
|
||||
// Exposed as a base error to wrap it with plugin downstream errors.
|
||||
ErrPluginDownstreamErrorBase = errutil.Internal("plugin.downstreamError",
|
||||
errutil.WithPublicMessage("An error occurred within the plugin"),
|
||||
errutil.WithDownstream())
|
||||
)
|
||||
|
Reference in New Issue
Block a user