Skip to content

Swallowed errors in bravefile run#114

Merged
idroz merged 1 commit intobravetools:masterfrom
Szubie:bravefile-command-errors
Jul 19, 2022
Merged

Swallowed errors in bravefile run#114
idroz merged 1 commit intobravetools:masterfrom
Szubie:bravefile-command-errors

Conversation

@Szubie
Copy link
Collaborator

@Szubie Szubie commented Jul 19, 2022

Currently errors from commands and their exit codes are only checked once at the end of bravefileRun function after looping through all commands. However, this means that only errors encountered on the last command will be caught - any earlier errors are overwritten by the last command. This means an error in early stages of bravefileRun will be swallowed silently.

Instead, we can check for errors on every iteration of loop runinng commands in bravefile run section and return early if we find any. This will prevent errors from earlier commands being overwritten and ignored.

To make this change, I needed to interpret non-zero exit codes as errors in bravefileRun function itself to terminate the loop. This was done anyway in host_api.go so should cause any new issues.

…file run section. Prevents errors from earlier commands being overwritten and ignored.
@idroz idroz merged commit 4bfb354 into bravetools:master Jul 19, 2022
@Szubie Szubie deleted the bravefile-command-errors branch July 19, 2022 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants