Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

ARM/ASM: Inconsistent exit codes upon errors #2155

Closed
ahmetb opened this issue Sep 29, 2015 · 0 comments · Fixed by #2784
Closed

ARM/ASM: Inconsistent exit codes upon errors #2155

ahmetb opened this issue Sep 29, 2015 · 0 comments · Fixed by #2784
Assignees
Labels

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Sep 29, 2015

Haven't dug so deeply however I can tell certain errors do not exit with a non-zero exit code upon failure:

$ azure vm foo; echo ExitCode=$?
error:   'foo' is not an azure command. See 'azure help'.
ExitCode=0

vs

$ azure account set; echo ExitCode=$?

  error: missing required argument `subscriptionNameOrId'

ExitCode=1

This is not ideal. Imagine someone having a script like:

doThis && \
    doThat && \
    azure account seth <subs_id> && \
    dropNuclearBomb

the error will not be effective and script will keep going instead of exiting.

Also an example from git:

$ git foo; echo ExitCode=$?
git: 'foo' is not a git command. See 'git --help'.

Did you mean this?
    log
ExitCode=1
@yugangw-msft yugangw-msft self-assigned this Oct 9, 2015
@mayurid mayurid added this to the May2016 - 0.9.20 milestone Apr 19, 2016
amarzavery added a commit to amarzavery/azure-xplat-cli that referenced this issue Apr 21, 2016
amarzavery added a commit that referenced this issue Apr 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants