sql: remove the usage of "errutil" (#81888)

This commit is contained in:
Gábor Farkas
2024-02-07 08:39:24 +01:00
committed by GitHub
parent 40a08a7720
commit 7b8c7b623c
4 changed files with 40 additions and 39 deletions
+1 -4
View File
@@ -21,14 +21,11 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util/errutil"
)
// MetaKeyExecutedQueryString is the key where the executed query should get stored
const MetaKeyExecutedQueryString = "executedQueryString"
var ErrConnectionFailed = errutil.Internal("sqleng.connectionError")
// SQLMacroEngine interpolates macros into sql. It takes in the Query to have access to query context and
// timeRange to be able to generate queries that use from and to.
type SQLMacroEngine interface {
@@ -112,7 +109,7 @@ func (e *DataSourceHandler) TransformQueryError(logger log.Logger, err error) er
var opErr *net.OpError
if errors.As(err, &opErr) {
logger.Error("Query error", "err", err)
return ErrConnectionFailed.Errorf("failed to connect to server - %s", e.userError)
return fmt.Errorf("failed to connect to server - %s", e.userError)
}
return e.queryResultTransformer.TransformQueryError(logger, err)