Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Improve error message for missing service name on env list #22

Closed
kalbir opened this issue Feb 3, 2018 · 0 comments
Closed

Improve error message for missing service name on env list #22

kalbir opened this issue Feb 3, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@kalbir
Copy link

kalbir commented Feb 3, 2018

When running fargate service env list -- i.e. missing the name of the service that I wanted to list the env variables for -- I got the following error:

$ fargate service env list
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/jpignata/fargate/cmd.glob..func16(0x1f424c0, 0x1f68320, 0x0, 0x0)
	/Users/jp/workspace/go/src/github.com/jpignata/fargate/cmd/service_env_list.go:18 +0x6c
github.com/spf13/cobra.(*Command).execute(0x1f424c0, 0x1f68320, 0x0, 0x0, 0x1f424c0, 0x1f68320)
	/Users/jp/workspace/go/src/github.com/spf13/cobra/command.go:750 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0x1f41740, 0xc42001e0b8, 0x0, 0xc420014f70)
	/Users/jp/workspace/go/src/github.com/spf13/cobra/command.go:831 +0x30e
github.com/spf13/cobra.(*Command).Execute(0x1f41740, 0x0, 0x0)
	/Users/jp/workspace/go/src/github.com/spf13/cobra/command.go:784 +0x2b
github.com/jpignata/fargate/cmd.Execute()
	/Users/jp/workspace/go/src/github.com/jpignata/fargate/cmd/root.go:149 +0x5e
main.main()
	/Users/jp/workspace/go/src/github.com/jpignata/fargate/main.go:8 +0x20

In comparison, running fargate service info (again missing service name), gives this much more helpful error message:

Error: accepts 1 arg(s), received 0
Usage:
  fargate service info <service-name> [flags]

Flags:
  -h, --help   help for info

Global Flags:
      --cluster string   ECS cluster name (default "fargate")
      --no-color         Disable color output
      --region string    AWS region (default "us-east-1")
  -v, --verbose          Verbose output

Would be good if the first was the same as the second.

@jpignata jpignata added the bug label Feb 3, 2018
@jpignata jpignata self-assigned this Feb 3, 2018
@jpignata jpignata added this to the v0.3.0 milestone Feb 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants