Skip to content

fai-do-scripts: stop at the first script exceeding $STOP_ON_ERROR#136

Open
peturingi wants to merge 1 commit intofaiproject:masterfrom
peturingi:fix-stop-on-error-per-script
Open

fai-do-scripts: stop at the first script exceeding $STOP_ON_ERROR#136
peturingi wants to merge 1 commit intofaiproject:masterfrom
peturingi:fix-stop-on-error-per-script

Conversation

@peturingi
Copy link
Copy Markdown

fai-do-scripts runs every script in a class directory and only returns an aggregate exit (100 + maxstatus) at the end. task_configure only then calls task_error 420 $?, which is where $STOP_ON_ERROR is consulted. As a result, setting STOP_ON_ERROR=1 does not prevent later scripts from running after one fails — the threshold is effectively only checked at the task boundary.

This change checks the offset exit value against $STOP_ON_ERROR inside savemaxstatus and aborts immediately when exceeded. The offset (100 + exitcode) matches what fai-do-scripts would have returned at the end, so callers see the same final exit code. With the default STOP_ON_ERROR=700 nothing changes in practice; only configurations that lower the threshold see the new per-script abort.

Copilot AI review requested due to automatic review settings April 20, 2026 19:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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