diff --git a/internal/step/plugin/provider.go b/internal/step/plugin/provider.go index 29a21e1d..6003cdf8 100644 --- a/internal/step/plugin/provider.go +++ b/internal/step/plugin/provider.go @@ -270,8 +270,12 @@ func (p *pluginProvider) LoadSchema(inputs map[string]any, _ map[string][]byte) cancel() // Close it. This allows it go get the error messages. deployerErr := pluginConnector.Close() - return nil, fmt.Errorf("failed to read plugin schema from '%s' (%w). Deployer close error: (%s)", - pluginSource, err, deployerErr.Error()) + if deployerErr != nil { + return nil, fmt.Errorf("failed to read plugin schema from '%s' (%w). Deployer close error: (%s)", + pluginSource, err, deployerErr.Error()) + } + return nil, fmt.Errorf("failed to read plugin schema from '%s' (%w)", + pluginSource, err) } // Tell the server that the client is done if err := transport.Close(); err != nil {