2022-09-14 11:19:57 -05:00
|
|
|
package plugins
|
|
|
|
|
|
|
|
import "github.com/grafana/grafana/pkg/util/errutil"
|
|
|
|
|
|
|
|
var (
|
2023-09-25 04:56:03 -05:00
|
|
|
errPluginNotRegisteredBase = errutil.NotFound("plugin.notRegistered",
|
|
|
|
errutil.WithPublicMessage("Plugin not registered"))
|
2022-09-14 11:19:57 -05:00
|
|
|
// ErrPluginNotRegistered error returned when a plugin is not registered.
|
2023-09-25 04:56:03 -05:00
|
|
|
ErrPluginNotRegistered = errPluginNotRegisteredBase.Errorf("plugin not registered")
|
|
|
|
|
|
|
|
errPluginUnavailableBase = errutil.Internal("plugin.unavailable",
|
|
|
|
errutil.WithPublicMessage("Plugin unavailable"))
|
2022-09-14 11:19:57 -05:00
|
|
|
// ErrPluginUnavailable error returned when a plugin is unavailable.
|
2023-09-25 04:56:03 -05:00
|
|
|
ErrPluginUnavailable = errPluginUnavailableBase.Errorf("plugin unavailable")
|
|
|
|
|
|
|
|
errMethodNotImplementedBase = errutil.NotFound("plugin.notImplemented",
|
|
|
|
errutil.WithPublicMessage("Method not implemented"))
|
2022-09-14 11:19:57 -05:00
|
|
|
// ErrMethodNotImplemented error returned when a plugin method is not implemented.
|
2023-09-25 04:56:03 -05:00
|
|
|
ErrMethodNotImplemented = errMethodNotImplementedBase.Errorf("method not implemented")
|
|
|
|
|
2023-09-27 02:44:43 -05:00
|
|
|
// ErrPluginHealthCheck error returned when a plugin fails its health check.
|
|
|
|
// Exposed as a base error to wrap it with plugin error.
|
|
|
|
ErrPluginHealthCheck = errutil.Internal("plugin.healthCheck",
|
|
|
|
errutil.WithPublicMessage("Plugin health check failed"),
|
|
|
|
errutil.WithDownstream())
|
|
|
|
|
2023-10-17 03:27:45 -05:00
|
|
|
// ErrPluginDownstreamErrorBase error returned when a plugin request fails.
|
2023-09-25 04:56:03 -05:00
|
|
|
// Exposed as a base error to wrap it with plugin downstream errors.
|
|
|
|
ErrPluginDownstreamErrorBase = errutil.Internal("plugin.downstreamError",
|
2023-09-11 05:13:13 -05:00
|
|
|
errutil.WithPublicMessage("An error occurred within the plugin"),
|
|
|
|
errutil.WithDownstream())
|
2023-10-10 05:28:39 -05:00
|
|
|
|
|
|
|
// ErrPluginRequestCanceledErrorBase error returned when a plugin request
|
|
|
|
// is cancelled by the client (context is cancelled).
|
|
|
|
// Exposed as a base error to wrap it with plugin cancelled errors.
|
|
|
|
ErrPluginRequestCanceledErrorBase = errutil.ClientClosedRequest("plugin.requestCanceled",
|
|
|
|
errutil.WithPublicMessage("Plugin request canceled"))
|
2022-09-14 11:19:57 -05:00
|
|
|
)
|