Skip to content

Commit 01ec2f9

Browse files
oharboeclaude
andcommitted
run_step.tcl: fail on any status but 0, the checkpoint written first
catch returns 1 for an error, and 3, 4 or another code for a break, continue or return -code that no loop caught; the handler read -errorinfo, which only an error has, so such a step failed on the missing key with neither its own message nor a checkpoint. Any status but 0 now writes the checkpoint and is raised again with return -options, its status, message and stack as they were. A top-level return in a step script is status 0, as source makes it, and still ends the step normally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 71b6b9b commit 01ec2f9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎flow/scripts/run_step.tcl‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ proc write_failure_checkpoint { } {
1717
write_db $::env(RESULTS_DIR)/failed.odb
1818
}
1919

20-
if { [catch { uplevel #0 [list source $::env(STEP_TCL)] } msg opts] } {
21-
set info [dict get $opts -errorinfo]
22-
set code [dict get $opts -errorcode]
20+
# Any status but 0 fails the step: an error, and a break, continue or
21+
# other code no loop caught. A top-level return in the script is status 0,
22+
# as source makes it. The status, message and stack are raised again as
23+
# they were.
24+
if { [catch { uplevel #0 [list source $::env(STEP_TCL)] } msg opts] != 0 } {
2325
if { [catch { write_failure_checkpoint } checkpoint_error] } {
2426
puts "Warning: failure checkpoint not written: $checkpoint_error"
2527
}
26-
error $msg $info $code
28+
return -options $opts $msg
2729
}

0 commit comments

Comments
 (0)