Explorar el Código

backend plugins: log an error if parsing meta field failed

Alexander Zobnin hace 7 años
padre
commit
214b9af5a3
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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
 		}