From: Ian Kelling Date: Mon, 16 Jul 2018 16:08:18 +0000 (-0400) Subject: doc wording, whitespace X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=364203b2705a32139dc7c8c97d656087aa7ed14e;p=errhandle.git doc wording, whitespace --- diff --git a/err b/err index f573fbb..4e5a1da 100644 --- a/err +++ b/err @@ -14,7 +14,6 @@ # limitations under the License. - # Commentary: Bash stack trace and error handling functions. This file # is meant to be sourced. It loads some functions which you may want to # call manually (see the comments at the start of each one), and then @@ -24,6 +23,7 @@ err-allow() { # help: turn off exit and stack trace on error. undoes err-catch set +E +o pipefail; trap ERR } + err-bash-trace() { # help: print stack trace # @@ -55,10 +55,11 @@ err-bash-trace() { echo \' done } + err-catch() { - # help: print stack trace and exit on error. + # help: on errors: print stack trace and exit # - # Set "${_errcatch_cleanup[@]}" to set a command which will run before exiting. + # You can set "${_errcatch_cleanup[@]}" to a command and it will run before exiting. # This function depends on err-bash-trace. set -E; shopt -s extdebug @@ -76,6 +77,7 @@ err-catch() { trap _err-trap ERR set -o pipefail } + err-exit() { # usage: err-exit [EXIT_CODE] [MESSAGE] # help: exit and print stack trace. @@ -102,4 +104,5 @@ err-exit() { echo "$0: exiting with code $code" exit $err } + err-catch