Skip to content

Commit

Permalink
Improve login message
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Jun 17, 2024
1 parent dd44de9 commit a67e52e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/cmd/cli/command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ var RootCmd = &cobra.Command{
}
// Login interactively now; only do this for authorization-related errors
if connect.CodeOf(err) == connect.CodeUnauthenticated {
term.Warn(prettyError(err))
term.Debug("Server error:", err)
term.Warn("Please log in to continue.")

defer trackCmd(nil, "Login", P{"reason", err})
if err = cli.InteractiveLogin(cmd.Context(), client, gitHubClientId, cluster); err != nil {
Expand Down Expand Up @@ -528,6 +529,7 @@ Generate will write files in the current folder. You can edit them and then depl
if connect.CodeOf(err) != connect.CodeUnauthenticated {
return err
}
// TODO: persist the terms agreement in the state file
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pkg/cli/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func Tail(ctx context.Context, client client.Client, params TailOptions) error {
case connect.CodeUnknown:
// Ignore unknown (nil) errors
default:
term.Warn(err)
term.Warn(err) // TODO: use prettyError(…)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/term/colorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
BrightCyan = termenv.ANSIBrightCyan
InfoColor = termenv.ANSIBrightMagenta
ErrorColor = termenv.ANSIBrightRed
WarnColor = termenv.ANSIBrightYellow
WarnColor = termenv.ANSIYellow // not bright to improve readability on light backgrounds
DebugColor = termenv.ANSIBrightBlack // Gray
)

Expand Down

0 comments on commit a67e52e

Please sign in to comment.