Skip to content

Commit

Permalink
Show a few lines of the log on fatal error.
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jul 28, 2017
1 parent 4a6f7b8 commit 914b04c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions slib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 914b04c

Please sign in to comment.