installer: preserve exit code in error handler
This commit is contained in:
@@ -74,6 +74,9 @@ restore_outputs() {
|
|||||||
|
|
||||||
# Error handler
|
# Error handler
|
||||||
catch_errors() {
|
catch_errors() {
|
||||||
|
# Store exit code before any conditionals or assignments overwrite $?.
|
||||||
|
local exit_code=$?
|
||||||
|
|
||||||
# Prevent recursive error handling
|
# Prevent recursive error handling
|
||||||
if [[ $ERROR_HANDLING == "true" ]]; then
|
if [[ $ERROR_HANDLING == "true" ]]; then
|
||||||
return
|
return
|
||||||
@@ -81,9 +84,6 @@ catch_errors() {
|
|||||||
ERROR_HANDLING=true
|
ERROR_HANDLING=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Store exit code immediately before it gets overwritten
|
|
||||||
local exit_code=$?
|
|
||||||
|
|
||||||
stop_log_output
|
stop_log_output
|
||||||
restore_outputs
|
restore_outputs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user