err_handler

This commit is contained in:
Didier Slof 2022-12-18 22:23:58 +01:00
parent acf3ba06c0
commit 11004129d6
Signed by: didier
GPG key ID: 01E71F18AA4398E5

View file

@ -57,6 +57,14 @@ main() {
bool "$RUN_CMDS" && _run_cmds
}
err_handler() {
echo "Something went wrong!"
echo "You can look at what went wrong by running this script more verbosely"
echo "Sorry!"
}
trap err_handler ERR
echo "# exec: start."
bool ${TIME_TRACK:-no} && time main "$@" || main "$@"
echo "# exec: done."