diff --git a/bin/miaou-bash b/bin/miaou-bash index 4873573..63f8382 100755 --- a/bin/miaou-bash +++ b/bin/miaou-bash @@ -90,6 +90,10 @@ function on_exit { if [[ -p /dev/stdout ]]; then failure_type='SUBSHELL TERM' failure_payload="$last_error" + + if [[ "$last_error" =~ $regex1 || "$last_error" =~ $regex2 ]]; then + failure_payload="${BASH_REMATCH[2]}" + fi last_error="${BASH_SOURCE[1]}:${BASH_LINENO[0]} subshell term $code" kill -USR1 $$ else @@ -100,7 +104,6 @@ function on_exit { if [[ "$last_error" =~ $regex1 || "$last_error" =~ $regex2 ]]; then line=${BASH_REMATCH[1]} message=${BASH_REMATCH[2]} - regex='^(.*): unbound variable$' if [[ $code == 1 ]] && [[ "$message" =~ $regex ]]; then failure_type='UNBOUND VARIABLE'