mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -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)
|
||||
if err != nil {
|
||||
queryResult.Error = e.queryResultTransformer.TransformQueryError(err)
|
||||
ch <- queryResult
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
@ -200,12 +201,14 @@ func (e *dataPlugin) DataQuery(ctx context.Context, dsInfo *models.DataSource,
|
||||
err := e.transformToTimeSeries(query, rows, &queryResult, queryContext)
|
||||
if err != nil {
|
||||
queryResult.Error = err
|
||||
ch <- queryResult
|
||||
return
|
||||
}
|
||||
case "table":
|
||||
err := e.transformToTable(query, rows, &queryResult, queryContext)
|
||||
if err != nil {
|
||||
queryResult.Error = err
|
||||
ch <- queryResult
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user