From 11004129d6f413e9261be2c09d5e312ed87bfae7 Mon Sep 17 00:00:00 2001 From: faulty Date: Sun, 18 Dec 2022 22:23:58 +0100 Subject: [PATCH] err_handler --- sync.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sync.sh b/sync.sh index f6a850e..79b7d1f 100755 --- a/sync.sh +++ b/sync.sh @@ -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."