Skip to content

Commit f47e43a

Browse files
authored
Support errorsource (#155)
* feat: support errorsource * Prepare v0.29.0 release
1 parent a9f736a commit f47e43a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 0.29.0
6+
* Support errorsource by @njvrzm in https://github.com/grafana/grafana-aws-sdk/pull/155
7+
* Add DatabaseCapacityUsageCountedForEvictPercentage for AWS/ElastiCache by @andriikushch in https://github.com/grafana/grafana-aws-sdk/pull/152
8+
* Add some missing metrics to AWS/ElastiCache by @andriikushch in https://github.com/grafana/grafana-aws-sdk/pull/153
9+
510
## 0.28.0
611

712
- Add SigV4MiddlewareWithAuthSettings and deprecate SigV4Middleware [#150](https://github.com/grafana/grafana-aws-sdk/pull/150)

pkg/awsds/asyncDatasource.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
1313
"github.com/grafana/grafana-plugin-sdk-go/data"
1414
"github.com/grafana/grafana-plugin-sdk-go/data/sqlutil"
15+
"github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource"
1516
"github.com/grafana/sqlds/v3"
1617
)
1718

@@ -117,10 +118,11 @@ func (ds *AsyncAWSDatasource) QueryData(ctx context.Context, req *backend.QueryD
117118
var frames data.Frames
118119
var err error
119120
frames, err = ds.handleAsyncQuery(ctx, query, req.PluginContext.DataSourceInstanceSettings.UID)
120-
response.Set(query.RefID, backend.DataResponse{
121-
Frames: frames,
122-
Error: err,
123-
})
121+
if err != nil {
122+
response.Set(query.RefID, errorsource.Response(err))
123+
} else {
124+
response.Set(query.RefID, backend.DataResponse{Frames: frames})
125+
}
124126

125127
wg.Done()
126128
}(q)

0 commit comments

Comments
 (0)