Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2022-03-10 02:54:22 +0300
committerBryan Drewery <bryan@shatow.net>2022-03-10 02:56:00 +0300
commita869290056645880e39fcc9f663e116d5e0b6717 (patch)
tree230e3049dc9541e6bab9fe900dd90699f3d9cd38 /src
parent912e294543f9cd140ad55dc7c9f736e3683961d4 (diff)
exit_handler: Alert if an unhandled error (set -e) is seen.
Issue #985
Diffstat (limited to 'src')
-rwxr-xr-xsrc/share/poudriere/common.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index 8590448b..242e9c5b 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -1280,10 +1280,12 @@ sig_handler() {
}
exit_handler() {
+ exit_status="$?"
case "${SHFLAGS}" in
*x*) ;;
*) local -; set +x ;;
esac
+
# Ignore errors while cleaning up
set +e
ERRORS_ARE_FATAL=0
@@ -1321,6 +1323,9 @@ exit_handler() {
cd "${MASTER_DATADIR}"
fi
fi
+ if [ "${exit_status}" -ne 0 ] && [ "${CRASHED:-0}" -eq 0 ]; then
+ echo "[ERROR] Unhandled error! Exiting ${exit_status}" >&2
+ fi
if was_a_jail_run; then
# Don't use jail for any caching in cleanup
SHASH_VAR_PATH="${SHASH_VAR_PATH_DEFAULT}"