Преглед изворни кода

backend plugins: log an error if parsing meta field failed

Alexander Zobnin пре 7 година
родитељ
комит
214b9af5a3
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go

+ 4 - 1
pkg/plugins/datasource/wrapper/datasource_plugin_wrapper.go

@@ -81,7 +81,10 @@ func (tw *DatasourcePluginWrapper) Query(ctx context.Context, ds *models.DataSou
 		}
 
 		if r.MetaJson != "" {
-			metaJson, _ := simplejson.NewJson([]byte(r.MetaJson))
+			metaJson, err := simplejson.NewJson([]byte(r.MetaJson))
+			if err != nil {
+				tw.logger.Error("Error parsing JSON Meta field: " + err.Error())
+			}
 			qr.Meta = metaJson
 		}