forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherrors.go
38 lines (31 loc) · 1.85 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package plugins
import "github.com/grafana/grafana/pkg/apimachinery/errutil"
var (
errPluginNotRegisteredBase = errutil.NotFound("plugin.notRegistered",
errutil.WithPublicMessage("Plugin not registered"))
// ErrPluginNotRegistered error returned when a plugin is not registered.
ErrPluginNotRegistered = errPluginNotRegisteredBase.Errorf("plugin not registered")
errPluginUnavailableBase = errutil.Internal("plugin.unavailable",
errutil.WithPublicMessage("Plugin unavailable"))
// ErrPluginUnavailable error returned when a plugin is 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 = errMethodNotImplementedBase.Errorf("method not implemented")
// 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())
// ErrPluginDownstreamErrorBase error returned when a plugin request fails.
// 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())
// 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"))
)