Add better error message when user inputs invalid value for environment flag
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
Research direction
Start with the Nais CLI implementations of kafka credentials, kafka grant-access, and kafka list, then trace how each environment flag is validated and how server errors are surfaced. Done means invalid dev/dev-gcp values produce specific guidance for the affected command instead of the generic server error.
Written by the indexing model from the issue text.
Description
I recently started to use the Nais CLI. While trying to run nais kafka credentials -t <team> -e dev-gcp --ttl 1d, I encountered an error message:
creating Kafka credentials: input:3:2: createKafkaCredentials The server errored out while processing your request, and we didn't write a suitable error message. You might consider that a bug on our side. Please try again, and if the error persists, contact the Nais team.
The error was caused by the environment flag being set to dev-gcp instead of dev. Running nais kafka grant-access or nais kafka list, however, accepts an environment flag dev-gcp, not dev.
As an easy mistake to make (and detect?), I suggest adding error messages explaining the invalid environment flag in the following cases:
nais kafka credentialsshould use-e dev, not-e dev-gcpnais kafka grant-accessshould use-e dev-gcp, not-e devnais kafka listshould use-e dev-gcp, not-e dev
- Dominant language
- Go
- Stars
- 2
- Forks
- 5
- Avg merge
- 6h 59m
- Merged PRs (30d)
- 36
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nais/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
Similar issues
-
Headerless responses block while skipping duplicate status linesPossibly taken @mynhe claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
projectdiscovery/rawhttp#554 ·
-
stage-fail
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siyuan-note/bazaar#2447 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
superplanehq/superplane#9120 ·
Maintainers usually reply within 1 day