improved error reporting and debug tracing

This commit is contained in:
Jaromil 2015-06-05 08:26:54 +02:00
parent 44f0a748ad
commit c8c521309e
1 changed files with 15 additions and 10 deletions

25
zuper
View File

@ -133,8 +133,22 @@ fn() {
fun="$@"
req=()
freq=()
func "$fun"
}
zerr() {
error "error in: ${fun:-$last_notice}"
[[ "$last_func" = "" ]] || warn "called in: $last_func"
[[ "$last_act" = "" ]] || warn "called in: $last_act"
[[ "$last_notice" = "" ]] || warn "called in: $last_notice"
# [[ "$fun" = "" ]] || warn "called in: $fun"
TRAPEXIT() {
error "error reported, operation aborted."
}
return 1
}
ckreq reqck() {
err=0
for v in $req; do
@ -153,19 +167,10 @@ ckreq reqck() {
err=1
}
done
[[ $err == 1 ]] && zerr
return $err
}
zerr() {
error "error in: ${fun:-$last_notice}"
[[ "$last_func" = "" ]] || warn "called in: $last_func"
[[ "$last_act" = "" ]] || warn "called in: $last_act"
[[ "$last_notice" = "" ]] || warn "called in: $last_notice"
[[ "$fun" = "" ]] || warn "called in: $fun"
error "error reported, operation aborted."
return 1
}
zdump() {
fn zdump
[[ ${#vars} -gt 0 ]] && {