installer: preserve exit code in error handler
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user