datawire / datawire-cli

Datawire Cloud tools and utilities
1 stars 0 forks source link

error message for non-existent different if no services exist vs other services exist #39

Open janicedatawire opened 8 years ago

janicedatawire commented 8 years ago

If I try to get a service token for a non-existent service and I have no services defined, I get the following response:

$ dwc service-token foo
failure: You haven't created any services in this org!

If I try the same thing with a non-existent service but I do have at least one service defined, I get a different error:

$ dwc service-token foo1
failure: You haven't created the foo1 service in this org!

$ dwc status
Logged in as [LG6FQ59JPF]jmk8@example.org:

Capabilities:
- dw:admin0: Organization administator
- dw:reqSvc0: Able to request service tokens
- dw:user0: User

Services defined:
- foo

It seems more consistent to always return the second response regardless. It isn't really relevant if other services exist if the service you're trying to access doesn't exist.