mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 17:06:57 -06:00
SQL: Fix so that all captured errors are returned from sql engine (#32353)
This commit is contained in:
parent
c8afce5fd6
commit
5985c199ae
@ -185,6 +185,7 @@ func (e *dataPlugin) DataQuery(ctx context.Context, dsInfo *models.DataSource,
|
|||||||
rows, err := db.Query(rawSQL)
|
rows, err := db.Query(rawSQL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
queryResult.Error = e.queryResultTransformer.TransformQueryError(err)
|
queryResult.Error = e.queryResultTransformer.TransformQueryError(err)
|
||||||
|
ch <- queryResult
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -200,12 +201,14 @@ func (e *dataPlugin) DataQuery(ctx context.Context, dsInfo *models.DataSource,
|
|||||||
err := e.transformToTimeSeries(query, rows, &queryResult, queryContext)
|
err := e.transformToTimeSeries(query, rows, &queryResult, queryContext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
queryResult.Error = err
|
queryResult.Error = err
|
||||||
|
ch <- queryResult
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case "table":
|
case "table":
|
||||||
err := e.transformToTable(query, rows, &queryResult, queryContext)
|
err := e.transformToTable(query, rows, &queryResult, queryContext)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
queryResult.Error = err
|
queryResult.Error = err
|
||||||
|
ch <- queryResult
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user