From 58f03a92166822e9f2436f381b3460d38540e8b1 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 22 May 2026 02:10:18 -0400 Subject: [PATCH] installer: preserve exit code in error handler --- install/helpers/errors.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 96b75f56..5a4c596d 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -74,6 +74,9 @@ restore_outputs() { # Error handler catch_errors() { + # Store exit code before any conditionals or assignments overwrite $?. + local exit_code=$? + # Prevent recursive error handling if [[ $ERROR_HANDLING == "true" ]]; then return @@ -81,9 +84,6 @@ catch_errors() { ERROR_HANDLING=true fi - # Store exit code immediately before it gets overwritten - local exit_code=$? - stop_log_output restore_outputs