diff --git a/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go b/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go index 91511f96685..f9c9f9d3b16 100644 --- a/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go +++ b/pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go @@ -69,10 +69,13 @@ func (tw *DatasourcePluginWrapper) Query(ctx context.Context, ds *models.DataSou for _, r := range pbres.Results { qr := &tsdb.QueryResult{ - RefId: r.RefId, - Series: []*tsdb.TimeSeries{}, - Error: errors.New(r.Error), - ErrorString: r.Error, + RefId: r.RefId, + Series: []*tsdb.TimeSeries{}, + } + + if r.Error != "" { + qr.Error = errors.New(r.Error) + qr.ErrorString = r.Error } for _, s := range r.GetSeries() {