SUBSHELL_ERROR caught up -> fd 4

This commit is contained in:
pvincent
2026-07-25 13:04:27 +04:00
parent 077a595c3a
commit 805dbce919
+12 -8
View File
@@ -166,8 +166,9 @@ function on_exit {
regex="╟─⟶" regex="╟─⟶"
if [[ "$last_error" =~ $regex ]]; then if [[ "$last_error" =~ $regex ]]; then
last_trim=false # keep the last error for next stacktrace last_trim=false # keep the last error for next stacktrace
error_block=false
failure_type='SUBSHELL_ERROR' failure_type='SUBSHELL_ERROR'
>&2 echo "SUBSHELL_ERROR caught up" >&4 echo "SUBSHELL_ERROR caught up"
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell:2)" stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell:2)"
[[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND' [[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND'
else else
@@ -179,7 +180,7 @@ function on_exit {
fi fi
fi fi
dump_failure "${last_trim:-true}" dump_failure "${last_trim:-true}" "${error_block:-true}"
else else
dump_success dump_success
fi fi
@@ -240,13 +241,16 @@ function dump_failure {
declare -F style_ansi >/dev/null || source "$MIAOU_BASH_DIR/lib/ansi.bash" declare -F style_ansi >/dev/null || source "$MIAOU_BASH_DIR/lib/ansi.bash"
dump_stderr "${1:-true}" dump_stderr "${1:-true}"
miaou_debug "---error box ${failure_type:-} ---" local error_block="${2:-true}"
if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then if is_true $error_block; then
: miaou_debug "---error box ${failure_type:-} ---"
else if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then
>&4 ansi_block_error "$failure_type" "$failure_payload" "$code" :
else
>&4 ansi_block_error "$failure_type" "$failure_payload" "$code"
fi
miaou_debug '---end of error box---'
fi fi
miaou_debug '---end of error box---'
miaou_debug '---stacktrace---' miaou_debug '---stacktrace---'
>&4 ansi_traces stack_sources stack_lines stack_functions >&4 ansi_traces stack_sources stack_lines stack_functions