err_handler
This commit is contained in:
parent
acf3ba06c0
commit
11004129d6
1 changed files with 8 additions and 0 deletions
8
sync.sh
8
sync.sh
|
@ -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."
|
||||||
|
|
Loading…
Reference in a new issue