datasource: add testing error to make sure its the right place
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
ErrNonMetricQueryNotSupported = errors.New("non-metrics queries are not supported")
|
ErrNonMetricQueryNotSupported = errors.New("non-metrics queries are not supported")
|
||||||
|
test = errors.New("This is a test error")
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZabbixDatasource struct {
|
type ZabbixDatasource struct {
|
||||||
@@ -147,6 +148,8 @@ func (ds *ZabbixDatasource) QueryData(ctx context.Context, req *backend.QueryDat
|
|||||||
frames, queryErr = zabbixDS.queryNumericItems(queryCtx, &query)
|
frames, queryErr = zabbixDS.queryNumericItems(queryCtx, &query)
|
||||||
case MODE_ITEMID:
|
case MODE_ITEMID:
|
||||||
frames, queryErr = zabbixDS.queryItemIdData(queryCtx, &query)
|
frames, queryErr = zabbixDS.queryItemIdData(queryCtx, &query)
|
||||||
|
case MODE_PROBLEMS:
|
||||||
|
queryErr = backend.DownstreamError(test) //send a test error
|
||||||
default:
|
default:
|
||||||
queryErr = backend.DownstreamError(ErrNonMetricQueryNotSupported)
|
queryErr = backend.DownstreamError(ErrNonMetricQueryNotSupported)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user