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

Can stack local-preview determine 40X errors? #219

Closed
leetrout opened this issue Feb 26, 2024 · 1 comment · Fixed by #245
Closed

Can stack local-preview determine 40X errors? #219

leetrout opened this issue Feb 26, 2024 · 1 comment · Fixed by #245
Labels
needs-investigation This issue requires further examination to determine its validity or scope

Comments

@leetrout
Copy link
Contributor

When running local preview without a valid auth token:

$ spacectl stack local-preview
2024/02/26 15:53:14 no stack found: no --id flag was provided and stack could not be found by searching the current directory

The stack is not found because the token is invalid.

When passing an explicit id the message is more helpful and notes that I am unauthorized:

$ spacectl stack local-preview --id ansible-pmm
2024/02/26 15:53:36 failed to check if stack exists: failed to query GraphQL API when checking if a stack exists: unauthorized: you can re-login using `spacectl profile login`

I think it would be more helpful if we can determine the user is unauthorized when trying to discover the stack in the first incantation.

@tomasmik
Copy link
Contributor

This is a bit strange, had a quick look at it and both of these paths use the same graphql client and parse the responses in the same way, but they react different to the unauthorised error. Might not be a very simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-investigation This issue requires further examination to determine its validity or scope
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants