err_handler

This commit is contained in:
Strix 2023-10-14 22:38:04 +02:00
parent e97067be10
commit 62e049de78
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774

View file

@ -57,6 +57,14 @@ main() {
bool "$RUN_CMDS" && _run_cmds 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." echo "# exec: start."
bool ${TIME_TRACK:-no} && time main "$@" || main "$@" bool ${TIME_TRACK:-no} && time main "$@" || main "$@"
echo "# exec: done." echo "# exec: done."