From 914b04c48042de96f3761e2351519235c4214151 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Fri, 28 Jul 2017 01:15:04 -0500 Subject: [PATCH] Show a few lines of the log on fatal error. --- slib.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slib.sh b/slib.sh index a00875a..c2d3e16 100644 --- a/slib.sh +++ b/slib.sh @@ -17,6 +17,7 @@ cleanup () { done fi } +# This tries to catch any exit, whether normal or forced (e.g. Ctrl-C) trap cleanup INT EXIT QUIT TERM # scolors - Color constants @@ -373,6 +374,8 @@ run_ok () { if [ "$RUN_ERRORS_FATAL" ]; then echo log_fatal "Something went wrong with the previous command. Exiting." + log_fatal "The last few log entries were:" + tail -15 ${RUN_LOG} exit 1 fi return ${res}