mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
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.
This commit is contained in:
committed by
GitHub
parent
abdfadf8cb
commit
41c505f03b
@@ -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())
|
||||
|
||||
+7
-1
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user