Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Errors should have a non-zero return code. #132

Open
philip-dakno opened this issue Sep 9, 2016 · 3 comments
Open

Errors should have a non-zero return code. #132

philip-dakno opened this issue Sep 9, 2016 · 3 comments

Comments

@philip-dakno
Copy link

Commands that result in an error are still returning zero. It would be helpful if those returned something non-zero. I would like to be able do something like this in the shell:

storm edit alias alias.domain.com:2222 || storm add alias alias.domain.com:2222

Another idea would be to add an "editadd" command, either way non-zero return codes on errors would be nice. An could submit a path for either or both is that's agreeable.

@waghanza
Copy link

@philip-dakno I think adding a "editadd" command will break the code readability.

The main, problem here is that a failed command does not have the behaviour expected by ||.

I think it's a better idea to return a non-zero code when failing

@philwrenn
Copy link
Contributor

#159

@EugenMayer
Copy link

ran into the same issue.. helped myself with

(storm add {{item.name}} {{item.user}}@{{item.host}}:{{item.port}} | grep -v error) || storm edit {{item.name}} {{item.user}}@{{item.host}}:{{item.port}}

for "add or update" in ansible .. so grep -v error .. but thats for sure not how it should be designed right

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants