grafana/pkg/plugins/errors.go
Will Browne 29327cbba2
Plugins: Use error plane for api/ds/query (#54750)
* plugin client returns error base

* fix api test

* add plugin client test

* add fallback err

* fix linting

* wip

* replace bad query

* template is an error

* failing test of templated error

* add one test passing

* fix failing test

* move test

* rename ErrBadQuery to ErrQueryValidationFailure

* tidy diff

* Change to one error per specific error kind

* last err + fix test

* fix imports

* more tests

* keep req vars together

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-09-14 18:19:57 +02:00

17 lines
994 B
Go

package plugins
import "github.com/grafana/grafana/pkg/util/errutil"
var (
// ErrPluginNotRegistered error returned when a plugin is not registered.
ErrPluginNotRegistered = errutil.NewBase(errutil.StatusNotFound, "plugin.notRegistered")
// ErrHealthCheckFailed error returned when a plugin health check failed.
ErrHealthCheckFailed = errutil.NewBase(errutil.StatusInternal, "plugin.failedHealthCheck")
// ErrPluginUnavailable error returned when a plugin is unavailable.
ErrPluginUnavailable = errutil.NewBase(errutil.StatusInternal, "plugin.unavailable")
// ErrMethodNotImplemented error returned when a plugin method is not implemented.
ErrMethodNotImplemented = errutil.NewBase(errutil.StatusNotImplemented, "plugin.notImplemented")
// ErrPluginDownstreamError error returned when a plugin method is not implemented.
ErrPluginDownstreamError = errutil.NewBase(errutil.StatusInternal, "plugin.downstreamError", errutil.WithPublicMessage("An error occurred within the plugin"))
)