Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
priteshbandi committed Nov 1, 2024
1 parent f8a5ac0 commit 5d4e832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (c execCommander) Output(ctx context.Context, name string, command plugin.C
err := cmd.Run()
if err != nil {
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
return nil, stderr.Bytes(), fmt.Errorf("'%s %s' command execution timeout: %s", name, string(command), err.Error());
return nil, stderr.Bytes(), fmt.Errorf("'%s %s' command execution timeout: %w", name, string(command), err);
}
return nil, stderr.Bytes(), err
}
Expand Down
3 changes: 1 addition & 2 deletions plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ func TestNewCLIPlugin_Error(t *testing.T) {
defer cancel()

var twoSeconds proto.Command
twoSeconds = "10"

twoSeconds = "2"
_, _, err := execCommander{}.Output(ctxWithTimout, "sleep", twoSeconds, nil);
if err == nil {
t.Errorf("execCommander{}.Output() expected error = %v, got nil", expectedErrMsg)
Expand Down

0 comments on commit 5d4e832

Please sign in to comment.