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 () {
errCode="error_$1"
eval errReport='$'"$errCode"
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
printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \
"$(stamp)" "$1" "$2" >> "$logFile"
exit "$1"
}