Skip to content
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

Avoid panicking on CLI error #203

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

blast-hardcheese
Copy link
Collaborator

This isn't great:

$ upm init
Error: unknown command "init" for "upm"

Did you mean this?
        info

Run 'upm --help' for usage.
panic: unknown command "init" for "upm"

Did you mean this?
        info


goroutine 1 [running]:
github.com/replit/upm/internal/cli.DoCLI()
        .../upm/internal/cli/cli.go:344 +0x1888
main.main()
        .../upm/cmd/upm/main.go:10 +0x1c

Since cobra already does its own error logging, we can probably just exit 1 and call it a day.

@blast-hardcheese blast-hardcheese added the bug Something isn't working label Dec 29, 2023
@blast-hardcheese blast-hardcheese requested a review from a team as a code owner December 29, 2023 02:35
@blast-hardcheese blast-hardcheese requested review from airportyh and removed request for a team December 29, 2023 02:35
Copy link
Member

@masad-frost masad-frost left a comment

Choose a reason for hiding this comment

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

Oof, thanks.

@blast-hardcheese blast-hardcheese merged commit 712cd0d into main Dec 29, 2023
3 checks passed
@blast-hardcheese blast-hardcheese deleted the dstewart/chore/avoid-cli-panic branch December 29, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants