Skip to content

Commit

Permalink
change error wraping for init
Browse files Browse the repository at this point in the history
Signed-off-by: zachaller <[email protected]>
  • Loading branch information
zachaller committed Mar 1, 2023
1 parent b31516b commit c4a6bcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions metricproviders/plugin/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func (m *metricPlugin) startPluginSystem(metric v1alpha1.Metric) (rpc.MetricProv
}
m.plugin[pluginName] = pluginType

err = m.plugin[pluginName].InitPlugin()
if err.Error() != "" {
resp := m.plugin[pluginName].InitPlugin()
if resp.HasError() {
return nil, fmt.Errorf("unable to initialize plugin via rpc (%s): %w", pluginName, err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions rollout/trafficrouting/plugin/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ func (t *trafficPlugin) startPlugin(pluginName string) (rpc.TrafficRouterPlugin,
}
t.plugin[pluginName] = pluginType

err = t.plugin[pluginName].InitPlugin()
if err.Error() != "" {
resp := t.plugin[pluginName].InitPlugin()
if resp.HasError() {
return nil, fmt.Errorf("unable to initialize plugin via rpc (%s): %w", pluginName, err)
}
}
Expand Down

0 comments on commit c4a6bcb

Please sign in to comment.