From 896d29964a259663cb4da9710eb4bd0cfce711aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Martin-Leg=C3=A8ne?= <robert@nic.ar>
Date: Thu, 27 Sep 2018 13:05:51 -0300
Subject: [PATCH] Supporting better error text

---
 bin/libbfa.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/libbfa.sh b/bin/libbfa.sh
index d560c9b..ec80500 100644
--- a/bin/libbfa.sh
+++ b/bin/libbfa.sh
@@ -10,7 +10,12 @@ function    fatal()
     exit 1
 }
 
-trap "fatal Argh!" ERR
+function    errtrap
+{
+    fatal "${ERRTEXT:-Argh!}"
+}
+
+trap errtrap ERR
 test -n "$BASH_VERSION"		                                ||
     fatal "This file must be source(d) from bash."
 test "$( caller 2>/dev/null | awk '{print $1}' )" != "0"	||
-- 
GitLab