From 6a4baba2859d979fe76b699c63347249cafa3ece Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 4 Sep 2023 12:48:10 +0100 Subject: [PATCH] refactor: improve error handling and display in core_exit.sh and install_config.sh - In core_exit.sh, added a check to set exit code to 4 if it is not already set. - In install_config.sh, improved the display of missing config file by highlighting the file path. These changes aim to enhance the error handling and provide clearer information to users. --- lgsm/modules/core_exit.sh | 2 ++ lgsm/modules/install_config.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index a66744b19..6947a3d4a 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -35,7 +35,9 @@ elif [ "${exitcode}" != "0" ]; then elif [ "${exitcode}" == "3" ]; then fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else + # if exit code is not set assume error. fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + exitcode=4 fi fn_exit_dev_debug # remove trap. diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 315aaaba2..a5c2787fc 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -154,7 +154,7 @@ fn_list_config_locations() { elif [ -d "${servercfgfullpath}" ]; then echo -e "Game Server Config Dir: ${servercfgfullpath}" else - echo -e "Config file: ${red}${servercfgfullpath} (${red}FILE MISSING${default})" + echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" fi fi echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}"