-
Notifications
You must be signed in to change notification settings - Fork 13
fix: restore hints when unauthorized #321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,10 +153,11 @@ func formatErr(err error) string { | |
| case errors.Is(err, auth.ErrNoTrialLicense): | ||
| return errStyle.Render("Could not download license, trial not started") | ||
| case errors.Is(err, dbc.ErrUnauthorized): | ||
| return errStyle.Render(err.Error()) | ||
| return errStyle.Render(err.Error()) + "\n" + | ||
| msgStyle.Render("Did you run `dbc auth login`?") | ||
| case errors.Is(err, dbc.ErrUnauthorizedColumnar): | ||
| return errStyle.Render(err.Error()) + "\n" + | ||
| msgStyle.Render("Installing this driver requires a license. Verify you have an active license at https://console.columnar.tech/licenses and try this command again. Contact support@columnar.tech if you believe this is an error.") | ||
| msgStyle.Render("Do you have an active license for this driver? Contact support@columnar.tech for assistance.") | ||
|
zeroshade marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was reverting this improvement to the error message intended here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's a good point and my mistake there. The current version of this is better, i'll fix that |
||
| default: | ||
| return errStyle.Render("Error: " + err.Error()) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msgStyleis defined incmd/dbc/add.gobut is now also used bycmd/dbc/main.go. To avoid hidden cross-file coupling (and make styles easier to discover), consider movingmsgStyle(and possiblyerrStyle) into a dedicated shared file (e.g.,cmd/dbc/styles.go) in themainpackage.