Revision 9069
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
54 | 54 |
fi # load new aliases |
55 | 55 |
if self_being_included; then |
56 | 56 |
|
57 |
# usage: cmd || die msg |
|
58 |
die () { save_e; echo "$1" >&2; rethrow; } |
|
59 |
|
|
60 | 57 |
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try |
61 | 58 |
|
62 | 59 |
function try () { e=0; "$@" || { export_e; true; }; } |
... | ... | |
132 | 129 |
# usage: cmd || { save_e; log_e; ...; rethrow; } |
133 | 130 |
log_e () { echo "! command exited with error $e" >&2; } |
134 | 131 |
|
132 |
# usage: cmd || die msg |
|
133 |
die () { save_e; echo "$1" >&2; rethrow; } |
|
134 |
|
|
135 | 135 |
: "${log_indent= }" |
136 | 136 |
|
137 | 137 |
# usage: in func: inc_log_level; ... |
Also available in: Unified diff
lib/sh/util.sh: moved die () into verbose output so it can use logging functions