diff --git a/commands/auth.go b/commands/auth.go index 83ed05855..906e66172 100644 --- a/commands/auth.go +++ b/commands/auth.go @@ -209,9 +209,7 @@ func loginCmdF(cmd *cobra.Command, args []string) error { c, _, err = InitClientWithUsernameAndPassword(username, password, url, allowInsecureSHA1, allowInsecureTLS) } if err != nil { - printer.PrintError(err.Error()) - // We don't want usage to be printed as the command was correctly built - return nil + return fmt.Errorf("could not initiate client: %w", err) } accessToken = c.AuthToken } else { @@ -222,9 +220,7 @@ func loginCmdF(cmd *cobra.Command, args []string) error { AuthToken: accessToken, } if _, _, err := InitClientWithCredentials(&credentials, allowInsecureSHA1, allowInsecureTLS); err != nil { - printer.PrintError(err.Error()) - // We don't want usage to be printed as the command was correctly built - return nil + return fmt.Errorf("could not initiate client: %w", err) } }