Exit with error on untrapped error detected

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-03-09 20:36:27 +00:00
parent d455e84b7e
commit 598b8f8617
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -5773,10 +5773,14 @@ esac
# Check for untrapped errors # Check for untrapped errors
# shellcheck disable=SC2181 # shellcheck disable=SC2181
[ $? = 0 ] || warn "Untrapped error detected!" if [ $? = 0 ]; then
# Do 'cleanup ok' on successful completion # Do 'cleanup ok' on successful completion
#print "mktemp_counter: $mktemp_counter uses" #print "mktemp_counter: $mktemp_counter uses"
cleanup ok cleanup ok
fi
# Otherwise, exit with error
warn "Untrapped error detected!"
cleanup
# vim: ft=sh nu ai sw=8 ts=8 noet # vim: ft=sh nu ai sw=8 ts=8 noet