From 41c505f03bc6db07bab8b2658b48c88d9f5b2096 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 10 Mar 2026 12:08:40 +0200 Subject: [PATCH] fix(cli): handle ignored errors in ssh and scaletest commands (#22852) Handle errors that were previously assigned to blank identifiers in the `cli/` package. - ssh.go: Log ExistsViaCoderConnect DNS lookup error at debug level instead of silently discarding it. Fallthrough behavior preserved. - exp_scaletest_llmmock.go: Log srv.Stop() error via the existing logger instead of discarding it. --- cli/exp_scaletest_llmmock.go | 4 +++- cli/ssh.go | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/exp_scaletest_llmmock.go b/cli/exp_scaletest_llmmock.go index e4c4bb247b..fa61b8e378 100644 --- a/cli/exp_scaletest_llmmock.go +++ b/cli/exp_scaletest_llmmock.go @@ -57,7 +57,9 @@ func (*RootCmd) scaletestLLMMock() *serpent.Command { return xerrors.Errorf("start mock LLM server: %w", err) } defer func() { - _ = srv.Stop() + if err := srv.Stop(); err != nil { + logger.Error(ctx, "failed to stop mock LLM server", slog.Error(err)) + } }() _, _ = fmt.Fprintf(inv.Stdout, "Mock LLM API server started on %s\n", srv.APIAddress()) diff --git a/cli/ssh.go b/cli/ssh.go index 2b3802b9fa..29b2967269 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -357,7 +357,13 @@ func (r *RootCmd) ssh() *serpent.Command { // search domain expansion, which can add 20-30s of // delay on corporate networks with search domains // configured. - exists, _ := workspacesdk.ExistsViaCoderConnect(ctx, coderConnectHost+".") + exists, ccErr := workspacesdk.ExistsViaCoderConnect(ctx, coderConnectHost+".") + if ccErr != nil { + logger.Debug(ctx, "failed to check coder connect", + slog.F("hostname", coderConnectHost), + slog.Error(ccErr), + ) + } if exists { defer cancel()