-
Notifications
You must be signed in to change notification settings - Fork 101
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Currently we have failed block that runs when a failure has to be handled. We already expose then block which exposes error code under a variable.
$ ... $ then(exit_code) {
echo exit_code
}
Add ability to do the same for failure block.
Describe the solution you'd like
Ability to run this block of code like this
$ ... $ failed(code) {
echo code
}
Additional context
This is important because in the handling block we may run multiple other failing expression, thus introducing a necessity to create a failed variable.
// Before
$ ... $ failed {
let error = status
trust $ ... $
echo "Exit code: {error}"
}
// After
$ ... $ failed(error) {
trust $ ... $
echo "Exit code: {error}"
}
Copilot
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request