Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add verbose error messaging#3053

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sreya merged 6 commits intomainfromjon/fixerrors
Jul 20, 2022
Merged

feat: add verbose error messaging#3053

sreya merged 6 commits intomainfromjon/fixerrors
Jul 20, 2022

Conversation

sreya
Copy link
Collaborator

@sreyasreya commentedJul 20, 2022
edited
Loading

  • fix an issue wherelogin fatally errored when checking versions.

Regular output:

image

Verbose output:

image

@sreyasreya requested a review frommafredriJuly 20, 2022 00:08
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Other than thecheckVersions function that could do with a cleanup, this looks great!

The only thing I noticed isn't touched by this PR, so not exactly relevant, but documenting it anyhow:

We probably shouldn't output the version check error when we can't reach the API as it adds verbosity to the output:
image


_, _ = fmt.Fprint(&output, helpErrMsg)

return cliui.Styles.Error.Render(output.String())
}

func checkVersions(cmd *cobra.Command, client *codersdk.Client) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Happened to notice this function still uses hard-coded version ofvarNoVersionCheck and also has a suppression check (which we're doing in the pre-run as well), do we want to keep both?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch, we don'tneed to keep both checks but I kept the check at the top of the the pre-run to avoid the unnecessary I/O of instantiating a client that we immediately throw away when someone passes the disable-warning flag.

@sreya
Copy link
CollaboratorAuthor

The only thing I noticed isn't touched by this PR, so not exactly relevant, but documenting it anyhow:
We probably shouldn't output the version check error when we can't reach the API as it adds verbosity to the output:

Great point I'll open up another PR to clean up some of that noise

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@sreya@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp