@xdhmoore, this question in your comment indeed works, as well as @Weekend suggestion.
Look at the snippet:
#!/bin/zsh
err_handler() {
echo error at $funcfiletrace[1]
}
trap err_handler ZERR
myfunc() {
(( 1/0 ))
}
myfunc
It will produce:
myfunc:1: division by zero
error at ./test:9
Line 9 contains (( 1/0 )) statement which rises the error.