error-handler

This commit is contained in:
CanbiZ 2025-09-16 09:59:06 +02:00
parent ce79bd0c08
commit 0e66031e3c
2 changed files with 3 additions and 5 deletions

View File

@ -202,10 +202,8 @@ silent() {
if [[ $rc -ne 0 ]]; then
BASH_COMMAND="$cmd"
error_handler "$rc"
return $rc
fi
return $rc
}
# Check if the shell is using bash

View File

@ -85,8 +85,8 @@ error_handler() {
local line_number=${BASH_LINENO[0]:-unknown}
local command=${BASH_COMMAND:-unknown}
# $STD im Kommando entfernen (nur kosmetisch)
command=${command//\$STD /}
# $STD removal to show the actual failing command
command="${command//\$STD/}"
if [[ "$exit_code" -eq 0 ]]; then
return 0