SUBSHELL_ERROR caught up -> fd 4
This commit is contained in:
+12
-8
@@ -166,8 +166,9 @@ function on_exit {
|
||||
regex="╟─⟶"
|
||||
if [[ "$last_error" =~ $regex ]]; then
|
||||
last_trim=false # keep the last error for next stacktrace
|
||||
error_block=false
|
||||
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)"
|
||||
[[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND'
|
||||
else
|
||||
@@ -179,7 +180,7 @@ function on_exit {
|
||||
fi
|
||||
fi
|
||||
|
||||
dump_failure "${last_trim:-true}"
|
||||
dump_failure "${last_trim:-true}" "${error_block:-true}"
|
||||
else
|
||||
dump_success
|
||||
fi
|
||||
@@ -240,13 +241,16 @@ function dump_failure {
|
||||
declare -F style_ansi >/dev/null || source "$MIAOU_BASH_DIR/lib/ansi.bash"
|
||||
dump_stderr "${1:-true}"
|
||||
|
||||
miaou_debug "---error box ${failure_type:-} ---"
|
||||
if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then
|
||||
:
|
||||
else
|
||||
>&4 ansi_block_error "$failure_type" "$failure_payload" "$code"
|
||||
local error_block="${2:-true}"
|
||||
if is_true $error_block; then
|
||||
miaou_debug "---error box ${failure_type:-} ---"
|
||||
if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then
|
||||
:
|
||||
else
|
||||
>&4 ansi_block_error "$failure_type" "$failure_payload" "$code"
|
||||
fi
|
||||
miaou_debug '---end of error box---'
|
||||
fi
|
||||
miaou_debug '---end of error box---'
|
||||
|
||||
miaou_debug '---stacktrace---'
|
||||
>&4 ansi_traces stack_sources stack_lines stack_functions
|
||||
|
||||
Reference in New Issue
Block a user