Skip to content

Commit f015e7f

Browse files
committed
update error message to nudge users toward --profile only
1 parent 9344eae commit f015e7f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

cmd/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func validateProfileHostConflict(ctx context.Context, profileName, host string,
9494

9595
if profileHost != flagHost {
9696
return fmt.Errorf(
97-
"--profile %q has host %q, which conflicts with --host %q. Use --profile alone or --host alone, not both",
97+
"--profile %q has host %q, which conflicts with --host %q. Use --profile only to select a profile",
9898
profileName, p.Host, host,
9999
)
100100
}

cmd/auth/auth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestValidateProfileHostConflict(t *testing.T) {
3939
name: "conflicting hosts produce error",
4040
profileName: "logfood",
4141
host: "https://other.cloud.databricks.com",
42-
wantErr: `--profile "logfood" has host "https://logfood.cloud.databricks.com", which conflicts with --host "https://other.cloud.databricks.com". Use --profile alone or --host alone, not both`,
42+
wantErr: `--profile "logfood" has host "https://logfood.cloud.databricks.com", which conflicts with --host "https://other.cloud.databricks.com". Use --profile only to select a profile`,
4343
},
4444
{
4545
name: "profile not found skips check",
@@ -87,7 +87,7 @@ func TestProfileHostConflictViaCobra(t *testing.T) {
8787
_, err := cli.ExecuteContextC(ctx)
8888
require.Error(t, err)
8989
assert.Contains(t, err.Error(), `--profile "profile-1" has host "https://www.host1.com", which conflicts with --host "https://other.host.com"`)
90-
assert.Contains(t, err.Error(), "Use --profile alone or --host alone, not both")
90+
assert.Contains(t, err.Error(), "Use --profile only to select a profile")
9191
}
9292

9393
// TestProfileHostConflictTokenViaCobra verifies the conflict check on the token subcommand.

0 commit comments

Comments
 (0)