Browse Source

SUBSHELL_ERROR caught up -> fd 4

main
pvincent 14 hours ago
parent
commit
805dbce919
  1. 8
      bin/miaou-bash

8
bin/miaou-bash

@ -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,6 +241,8 @@ 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}"
local error_block="${2:-true}"
if is_true $error_block; then
miaou_debug "---error box ${failure_type:-} ---" miaou_debug "---error box ${failure_type:-} ---"
if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then
: :
@ -247,6 +250,7 @@ function dump_failure {
>&4 ansi_block_error "$failure_type" "$failure_payload" "$code" >&4 ansi_block_error "$failure_type" "$failure_payload" "$code"
fi fi
miaou_debug '---end of error box---' miaou_debug '---end of error box---'
fi
miaou_debug '---stacktrace---' miaou_debug '---stacktrace---'
>&4 ansi_traces stack_sources stack_lines stack_functions >&4 ansi_traces stack_sources stack_lines stack_functions

Loading…
Cancel
Save