|
|
|
@ -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 |
|
|
|
|