func exitError: simplify
This commit is contained in:
parent
9e335224a0
commit
d41b0d13d3
@ -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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user