From 364203b2705a32139dc7c8c97d656087aa7ed14e Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 16 Jul 2018 12:08:18 -0400 Subject: [PATCH] doc wording, whitespace --- err | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 -- 2.25.1