https://pulumi.com logo
#general
Title
# general
b

best-waiter-16927

02/06/2020, 2:38 PM
Hey! We need a way to distinguish between different
pulumi up
failures (conflict, pending resources etc.). Other than running grep on output is there any other way? f.e. different exit codes to different errors?
w

white-balloon-205

02/06/2020, 3:43 PM
Currently we don’t have differentiated exit codes. Can you give more details on the errors you are trying to distinguish between? Would love to understand whether they are something we could ever imagine differentiating based on exit code - or whether they will better be solved by including error information in
—json
output or similar.
i

incalculable-diamond-5088

02/06/2020, 3:51 PM
That’s super useful! We’d like to have this for potential automatic recovery during deployments and/or taking other action (notifying) depending on the error
b

best-waiter-16927

02/06/2020, 3:58 PM
For example we would like to have a self healing automation in our deployment flow in case we failed with a 'pending resources' failure (fix stack and continue with deployment). In general i think it's a good practice (and a well adopted one) to have different exit codes to different errors in any CLI tool
Another example, in case of a conflict error (update already in progress) we might want to add a sleep to the process rather than fail the whole deployment. Regarding your suggestion, adding error information to json output is not that different than grep on stdout\stderr and might be more suitable to API calls but not to the pulumi CLI tool.
w

white-balloon-205

02/06/2020, 4:49 PM
Great. Those two examples are definitely things we could distinguish as unique exit codes. Would you mind opening an issue to suggest this? (I actually thought there was one already - we’ve definitely talked about this before - but couldn’t find it in a quick search).
b

best-waiter-16927

02/09/2020, 1:01 PM
Thanks @white-balloon-205 for your help! Opened an issue for this purpose: https://github.com/pulumi/pulumi/issues/3897
👍 1