Revert commit to run command a second time in errshow

This commit is contained in:
natemaia 2019-12-26 20:53:34 -08:00
parent 969cdf6c74
commit 343e9d88b1

View File

@ -2448,32 +2448,16 @@ errshow()
local fatal=$1 local fatal=$1
shift # always shift off the fatal level arg shift # always shift off the fatal level arg
local txt="\nCommand: $1\n\n\n\nError:\n$(errmsg)\n\n"
# try to rerun the command to make sure it's consistently failing
local err="$(errmsg)"
sleep 1 && $1 2> "$ERR"
[ $? -eq 0 ] && return 0
local err2="$(errmsg)"
if [[ $err == $err2 ]]; then # no need to show duplicate output
local txt="\nCommand: $1\n\n\n\nError:\n$err\n\n"
else
local txt="\nCommand: $1\n\n\n\nFirst run error:\n$err\n\nSecond run error:\n$err2\n\n"
fi
tput cnorm tput cnorm
if (( fatal )); then if (( fatal )); then
yesno "Install Error" "${txt}Errors at this stage must be fixed before the install can continue.\n$_errchoice" \ yesno "Install Error" "${txt}Errors at this stage must be fixed before the install can continue.\n$_errchoice" "Handle normally" "Continue, it's fixed" ||
"Handle normally" "Continue, it's fixed" || return 0 return 0
[[ -r $DBG && $TERM == 'linux' ]] && less "$DBG" [[ -r $DBG && $TERM == 'linux' ]] && less "$DBG"
die 1 die 1
fi fi
yesno "Install Error" "${txt}Errors at this stage may be fixed or ignored depending on the error.\n$_errchoice" "Handle normally" "Continue, it's fixed" &&
yesno "Install Error" "${txt}Errors at this stage may be fixed or ignored depending on the error.\n$_errchoice" \ return 1
"Handle normally" "Continue, it's fixed" && return 1
return 0 return 0
} }