Skip to content

Commit

Permalink
Only report error when error is present (#124)
Browse files Browse the repository at this point in the history
* Only report error when error is present

* Make picky CI happy
  • Loading branch information
jaredoconnell committed Nov 9, 2023
1 parent 85636b4 commit 02993c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/step/plugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 02993c6

Please sign in to comment.