Skip to content

Commit

Permalink
Merge branch 'main' into fix/908
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova authored Nov 22, 2024
2 parents e2e2254 + d44d3bd commit 99bd078
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-panthers-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'grafana-infinity-datasource': patch
---

Fix error source for invalid queries
3 changes: 1 addition & 2 deletions pkg/models/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ func LoadQuery(ctx context.Context, backendQuery backend.DataQuery, pluginContex
var query Query
err := json.Unmarshal(backendQuery.JSON, &query)
if err != nil {
// Plugin error as the user should not have been able to send a bad query
return query, errorsource.PluginError(fmt.Errorf("error while parsing the query json. %w", err), false)
return query, errorsource.DownstreamError(fmt.Errorf("error while parsing the query json. %w", err), false)
}
query = ApplyDefaultsToQuery(ctx, query, settings)
if query.PageMode == PaginationModeList && strings.TrimSpace(query.PageParamListFieldName) == "" {
Expand Down

0 comments on commit 99bd078

Please sign in to comment.