From 65af756fc33ce1a8960c690e681d12ebeef20750 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 14 Oct 2023 09:01:58 +0100 Subject: x/xx: slightly more verbose error messages Signed-off-by: Leah Rowe --- include/err.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/err.sh b/include/err.sh index 416c69af..12bba8fb 100755 --- a/include/err.sh +++ b/include/err.sh @@ -4,10 +4,17 @@ version=""; versiondate=""; projectname="" x_() { - [ $# -lt 1 ] || ${@} || err "non-zero exit status: ${@}" + [ $# -lt 1 ] || ${@} || err_exit err ${@} } xx_() { - [ $# -lt 1 ] || ${@} || fail "non-zero exit status: ${@}" + [ $# -lt 1 ] || ${@} || err_exit fail ${@} +} + +err_exit() +{ + _fail="${1}" && shift 1 + echo "Non-zero exit: $@" + $_fail "Unhandled error" } check_git() -- cgit v1.2.1