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

CLI should just exit on error rather than printing steps that didn't happen #270

Closed
dylanratcliffe opened this issue May 7, 2024 · 0 comments · Fixed by #293
Closed

Comments

@dylanratcliffe
Copy link
Member

dylanratcliffe commented May 7, 2024

If I get an error, there is a surprisingly large amount of output for an early error. For example if I force an error with a bad value for --app I see the following output:

❯ go run main.go terraform plan --app https://foo.bar.com
ERRO could not fetch instance-data                 error="Get \"https://foo.bar.com/api/public/instance-data\": dial tcp: lookup foo.bar.com: no such host"














                                                                                                                                                           ▓ Connecting to Overmind
⏳ Ensuring Token
⏳ Configuring AWS Access
⏳ Planning Changes
⏳ Processing Planned Changes
Error: failed to get instance data from app: could not fetch instance-data: Get "https://foo.bar.com/api/public/instance-data": dial tcp: lookup foo.bar.com: no such hos



  │ Fatal Error: failed to get instance data from app: could not fetch instance-
  │ data: Get "https://foo.bar.com/api/public/instance-data": dial tcp: lookup
  │ foo.bar.com: no such host

There are a number of issues here:

  • There is a lot of empty space for some reason
  • The "Connecting to Overmind" spinner is in a really weird spot, that isn't a bad copy-paste it actually looks like that
  • We still show all the other steps e.g. ⏳ Ensuring Token despite the fact that we never execute them
  • The 2nd last error (the same one as in the first line is truncated, but not the one that is wrapped) is truncated, it ends with "no such hos"
  • The last error is extremely hard to read on my screen
Screenshot 2024-05-07 at 9 20 48 PM

Another similar error example is this one:

❯ go run main.go terraform plan --app https://df.overmind-demo.com
✅ Connected to Overmind
▓ Ensuring Token
⏳ Configuring AWS Access
⏳ Planning Changes
⏳ Processing Planned Changes




✅ Connected to Overmind
⛔️ Ensuring Token Error: error getting device code: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_request","error_description":"Service not found: https://api.df.overmind-demo.com"}
⏳ Configuring AWS Access
⏳ Planning Changes
⏳ Processing Planned Changes
Error: error getting device code: oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_request","error_description":"Service not found: https://api.df.overmind-demo.com"}

Image:

Screenshot 2024-05-07 at 9 24 58 PM

Thie above one is better, but we still see steps executed that shouldn't be, dead whitespace, and the error being printed twice

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant