From 02993c6694ee34155254a41a684096f8553a0404 Mon Sep 17 00:00:00 2001 From: Jared O'Connell <46976761+jaredoconnell@users.noreply.github.com> Date: Thu, 9 Nov 2023 10:43:29 -0500 Subject: [PATCH] Only report error when error is present (#124) * Only report error when error is present * Make picky CI happy --- internal/step/plugin/provider.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 {