func exitError: simplify

This commit is contained in:
Asif Bacchus 2019-05-23 23:18:35 -06:00
parent 9e335224a0
commit d41b0d13d3

View File

@ -36,15 +36,8 @@ badParam () {
} }
exitError () { exitError () {
errCode="error_$1" printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \
eval errReport='$'"$errCode" "$(stamp)" "$1" "$2" >> "$logFile"
if [ -n "$errReport" ]; then
printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \
"$(stamp)" "$1" "$errReport" >> "$logFile"
else
printf "${err}[%s] -- [ERROR] Unknown error code reported --${norm}\n" \
"$(stamp)" >> "$logFile"
fi
exit "$1" exit "$1"
} }