Skip to content
Snippets Groups Projects
Commit 896d2996 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Supporting better error text

parent 86b11407
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,12 @@ function fatal() ...@@ -10,7 +10,12 @@ function fatal()
exit 1 exit 1
} }
trap "fatal Argh!" ERR function errtrap
{
fatal "${ERRTEXT:-Argh!}"
}
trap errtrap ERR
test -n "$BASH_VERSION" || test -n "$BASH_VERSION" ||
fatal "This file must be source(d) from bash." fatal "This file must be source(d) from bash."
test "$( caller 2>/dev/null | awk '{print $1}' )" != "0" || test "$( caller 2>/dev/null | awk '{print $1}' )" != "0" ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment