From d41b0d13d30b99b80610142fc6e8b2a814c23693 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 23 May 2019 23:18:35 -0600 Subject: [PATCH] func exitError: simplify --- backup_new.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/backup_new.sh b/backup_new.sh index 6bbd6d4..0c11363 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -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" }