fix: avoid emitting version warning when connection error encountered (#3082)

This commit is contained in:
Jon Ayers
2022-07-21 14:28:24 -05:00
committed by GitHub
parent 5b78251592
commit e01905821f
4 changed files with 91 additions and 2 deletions
+5
View File
@@ -455,6 +455,11 @@ func checkVersions(cmd *cobra.Command, client *codersdk.Client) error {
clientVersion := buildinfo.Version()
info, err := client.BuildInfo(cmd.Context())
// Avoid printing errors that are connection-related.
if codersdk.IsConnectionErr(err) {
return nil
}
if err != nil {
return xerrors.Errorf("build info: %w", err)
}