mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Influx/flux: include interpolated query with error (#25665)
with execution errors, return a Frame that has Meta.ExecutedQueryString.
This commit is contained in:
@@ -25,6 +25,11 @@ func ExecuteQuery(ctx context.Context, query QueryModel, runner queryRunner, max
|
||||
tables, err := runner.runQuery(ctx, flux)
|
||||
if err != nil {
|
||||
dr.Error = err
|
||||
metaFrame := data.NewFrame("meta for error")
|
||||
metaFrame.Meta = &data.FrameMeta{
|
||||
ExecutedQueryString: flux,
|
||||
}
|
||||
dr.Frames = append(dr.Frames, metaFrame)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -90,10 +90,7 @@ func RunnerFromDataSource(dsInfo *models.DataSource) (*Runner, error) {
|
||||
func backendDataResponseToTSDBResponse(dr *backend.DataResponse, refID string) *tsdb.QueryResult {
|
||||
qr := &tsdb.QueryResult{RefId: refID}
|
||||
|
||||
if dr.Error != nil {
|
||||
qr.Error = dr.Error
|
||||
return qr
|
||||
}
|
||||
qr.Error = dr.Error
|
||||
|
||||
if dr.Frames != nil {
|
||||
qr.Dataframes = tsdb.NewDecodedDataFrames(dr.Frames)
|
||||
|
||||
Reference in New Issue
Block a user