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
best-waiter-16927
02/06/2020, 4:01 PM
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).
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.