Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
124 stars 52 forks source link

Detect Azure CLI errors based on exit codes instead of `stderr` #129

Closed MoChilia closed 6 months ago

MoChilia commented 6 months ago

Description

According to https://github.com/Azure/cli/pull/57#discussion_r1414938960, stderr should never be used as an indicator of failure for Azure CLI commands. This pr identifies Azure CLI errors based on exit codes rather than relying on stderr. As stated in child_process.exec, any error resulting in an exit code other than 0 will lead to a rejected promise, throwing an error. Hence, the flow to L35 implies that the exit code for L34 is 0.

jiasli commented 6 months ago

Nice PR description. Concise and precise.