commit 70e7f3993fef34df77e644d35e36b899a46731f2
parent acb24d2453e0eb9d26df01f5afe6df4b2871058b
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Sat, 17 Sep 2022 12:47:30 +0200
Show call stack in die()
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/bin/confz b/bin/confz
@@ -4,7 +4,8 @@
autoload -Uz colors; colors
setopt extended_glob warn_create_global no_unset
-zmodload zsh/zutil
+zmodload zsh/zutil || exit $?
+zmodload zsh/parameter || exit $?
typeset -gA vars vars_prev
typeset -ga do_command actions_performed
@@ -16,6 +17,8 @@ typeset -g confz_indent check_only verbose fail_reason quiet
# helper that prints out error message and exits
die() {
+ print -r - "$fg_bold[red]Fatal$reset_color error occurend in:" >&2
+ printf '> %s\n' $funcfiletrace
print -r - "$fg_bold[red]*$reset_color $@" >&2
exit 1
}