This commit is contained in:
CanbiZ
2025-09-15 15:17:17 +02:00
parent 0f7a8351dd
commit 861c5070a7
3 changed files with 13 additions and 17 deletions

View File

@@ -37,15 +37,14 @@ trap on_terminate TERM
error_handler() {
local exit_code="$1"
local line_number="$2"
local command="$3"
local command="${3:-}"
# Exitcode 0 = kein Fehler → ignorieren
if [[ "$exit_code" -eq 0 ]]; then
return 0
fi
printf "\e[?25h"
echo -e "\n${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}\n"
echo -e "\n${RD}[ERROR]${CL} in line ${RD}${line_number}${CL}: exit code ${RD}${exit_code}${CL}: while executing command ${YW}${command}${CL}\n"
exit "$exit_code"
}