Improve error handling and silent logging

Expanded explain_exit_code with more exit codes for various tools (APT, Node.js, Python, databases) for better diagnostics. Updated silent() to set BASH_COMMAND on failure for improved error context.
This commit is contained in:
CanbiZ
2025-09-15 15:43:58 +02:00
parent eed916b6cc
commit a5a58d87b4
2 changed files with 50 additions and 2 deletions

View File

@@ -193,8 +193,13 @@ set_std_mode() {
SILENT_LOGFILE="/tmp/silent.$$.log"
silent() {
local cmd="$*"
"$@" >>"$SILENT_LOGFILE" 2>&1
return $?
local rc=$?
if [[ $rc -ne 0 ]]; then
BASH_COMMAND="$cmd"
fi
return $rc
}
# Function to download & save header files