From 3f50122eccffa748b41ec0f81db69601a897f2b5 Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 29 Jul 2026 21:01:51 +0400 Subject: [PATCH] small miaou_debug changes --- poc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/poc b/poc index 7d70205..8679297 100755 --- a/poc +++ b/poc @@ -202,8 +202,8 @@ function on_pipe { unset 'error_source[-1]' 'error_lineno[-1]' 'error_funcname[-1]' load_tmp_error - last_error="${tmp_error[-1]}" + regex='^(.*): line ([0-9]+): miaou_error: SUBSHELL_ERROR ([0-9]+) payload: (.*)$' if [[ $last_error =~ $regex ]]; then source=${BASH_REMATCH[1]} @@ -211,6 +211,7 @@ function on_pipe { failure_code=${BASH_REMATCH[3]} failure_payload=${BASH_REMATCH[4]} failure_type="SUBSHELL_ERROR" + miaou_debug "') @@ -218,7 +219,7 @@ function on_pipe { failure_code=141 failure_type="PIPE_ERROR" fi - miaou_debug "" + miaou_debug "" builtin exit "$failure_code" } @@ -340,7 +341,7 @@ function on_exit { unset 'tmp_error[-1]' add_miaou_error "${BASH_SOURCE[1]}" "${BASH_LINENO[0]}" "${failure_code}" "${failure_type}" "${failure_payload}" - miaou_debug "" + miaou_debug "" else failure_type='UNKNOWN ERROR' fi @@ -354,7 +355,7 @@ function on_exit { 2>&3 >&4 dump_stacktrace fi if [[ $code -gt 0 ]]; then - miaou_debug "" + miaou_debug "" else miaou_debug "" fi @@ -374,11 +375,9 @@ trap 'on_exit $?' EXIT trap 'on_pipe' PIPE trap 'on_return' RETURN -declare -a tmp_error # to prevent loading multiple times - if [[ -e /proc/$$/fd/3 ]]; then exec 4>&3 3>&-; else exec 4>/dev/tty; fi # swap fd 3 4 when fd 3 sent off exec 3>/dev/stderr 2>"$MIAOU_BASH_ERROR" -miaou_debug "" +miaou_debug "" # shellcheck source=/dev/null source "$BASH_ARGV0"