From: Ian Kelling Date: Mon, 22 Jul 2019 19:58:00 +0000 (-0400) Subject: better docs X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=62aed8ded6e0bb643a9dd6350558ffc23aae3c46;hp=fb79b8bd5a5fc79224b1ecfff94c39a351c4c63b;p=errhandle.git better docs --- diff --git a/err b/err index 1425306..580183c 100644 --- a/err +++ b/err @@ -20,22 +20,17 @@ # runs err-catch. See the README file for a slightly longer explanation. -####################################### -# Undoes err-catch. turns off exit and stack trace on error. -####################################### -err-allow() { - set +E +o pipefail; trap ERR -} - - ####################################### # Print stack trace # # usage: err-bash-trace [FRAME_START] # +# This function is called by the other functions which print stack +# traces. +# # It does not show function args unless you first run: # shopt -s extdebug -# which err-catch & err-print does for you. +# which err-catch & err-print do for you. # # FRAME_START The frame to start printing on. default=0. Useful when # printing from an ERR trap function to avoid printing @@ -91,6 +86,13 @@ err-catch() { set -o pipefail } +####################################### +# Undoes err-catch. turns off exit and stack trace on error. +####################################### +err-allow() { + set +E +o pipefail; trap ERR +} + ####################################### # On error, print stack trace ####################################### @@ -113,7 +115,7 @@ err-print() { ####################################### -# On error, print stack trace +# Print stack trace and exit # # Use this instead of the exit command to be more informative. #