Skip to content

Commit

Permalink
Only report error when error is present
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Nov 9, 2023
1 parent 85636b4 commit c93ccc6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/step/plugin/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,13 @@ 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)",
pluginSource, err)
} else {

Check warning on line 276 in internal/step/plugin/provider.go

View workflow job for this annotation

GitHub Actions / golangci-lint

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
return nil, fmt.Errorf("failed to read plugin schema from '%s' (%w). Deployer close error: (%s)",
pluginSource, err, deployerErr.Error())
}
}
// Tell the server that the client is done
if err := transport.Close(); err != nil {
Expand Down

0 comments on commit c93ccc6

Please sign in to comment.