Browse Source

flush or a tree of TMP_ERROR might be useful

main
pvincent 1 week ago
parent
commit
1d4d1e9a9c
  1. 11
      bin/bash-back
  2. 2
      lib/utility.bash
  3. 2
      useless.sh

11
bin/bash-back

@ -78,8 +78,15 @@ function on_exit {
stack_summary+=("ERROR $code: [$message]")
fi
else
# FIXME: should grab the whole stacktrace, then print back again,
# because previous stderr might disappear from the first script after calling subprocess!
# FIXME: should either
# 1. grab the whole stacktrace, then print back again
# 2. or FLUSH previous stderr
# because previous stderr might disappear from the first script when calling subprocess!
#
# ```bash
# >&2 echo some trace in stderr
# lib/utility.bash # which contains error
# ```
regex="^ .*:[0-9]* .*\$"
[[ "$last_error" =~ $regex ]] || stack_summary+=("ERROR $code: <undefined>")
fi

2
lib/utility.bash

@ -8,12 +8,12 @@ function blabla {
}
function suite {
echo $nope
return
exit
command_not_found
exit 10 # youpi
return 7
echo $nope
}
blabla

2
useless.sh

@ -32,8 +32,8 @@ function F3 {
echo start of useless
F3
>&2 echo some trace in stderr
. lib/utility.bash
lib/utility.bash
. lib/utility.bash
main
# error

Loading…
Cancel
Save