|
|
|
@ -165,13 +165,11 @@ function on_exit { |
|
|
|
miaou_debug "UNDEFINED last error=${last_error}" |
|
|
|
regex="╟─⟶" |
|
|
|
if [[ "$last_error" =~ $regex ]]; then |
|
|
|
if [[ "${code}" == 128 ]]; then |
|
|
|
failure_type='SUBSHELL_SOURCE_NOT_FOUND' |
|
|
|
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell:2)" |
|
|
|
else |
|
|
|
failure_type='SUBSHELL_ERROR' |
|
|
|
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell:3)" |
|
|
|
fi |
|
|
|
last_trim=false # keep the last error for next stacktrace |
|
|
|
failure_type='SUBSHELL_ERROR' |
|
|
|
>&2 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 |
|
|
|
failure_type='UNDEFINED' |
|
|
|
regex='^subshell term:' |
|
|
|
@ -181,7 +179,7 @@ function on_exit { |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
dump_failure |
|
|
|
dump_failure "${last_trim:-true}" |
|
|
|
else |
|
|
|
dump_success |
|
|
|
fi |
|
|
|
@ -240,7 +238,7 @@ function ansi_traces { |
|
|
|
} |
|
|
|
function dump_failure { |
|
|
|
declare -F style_ansi >/dev/null || source "$MIAOU_BASH_DIR/lib/ansi.bash" |
|
|
|
dump_stderr true |
|
|
|
dump_stderr "${1:-true}" |
|
|
|
|
|
|
|
miaou_debug "---error box ${failure_type:-} ---" |
|
|
|
if [[ ${failure_type} == 'SUBSHELL SOURCE NOT FOUND' ]]; then |
|
|
|
|