func exitError: simplify
This commit is contained in:
parent
9e335224a0
commit
d41b0d13d3
@ -36,15 +36,8 @@ badParam () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exitError () {
|
exitError () {
|
||||||
errCode="error_$1"
|
|
||||||
eval errReport='$'"$errCode"
|
|
||||||
if [ -n "$errReport" ]; then
|
|
||||||
printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \
|
printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \
|
||||||
"$(stamp)" "$1" "$errReport" >> "$logFile"
|
"$(stamp)" "$1" "$2" >> "$logFile"
|
||||||
else
|
|
||||||
printf "${err}[%s] -- [ERROR] Unknown error code reported --${norm}\n" \
|
|
||||||
"$(stamp)" >> "$logFile"
|
|
||||||
fi
|
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user