bashbot: add error Pocessing to SendJsonRetry

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-03-24 11:06:30 +01:00
parent f790d73e66
commit 4c4ba0ba5e

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing
# 10 - not bash!
#
#### $$VERSION$$ v1.5-0-g8adca9b
#### $$VERSION$$ v1.50-14-gf790d73
##################################################################
# are we running in a terminal?
@ -684,16 +684,16 @@ sendJsonResult(){
sendJsonRetry "$2" "${BASHBOT_RETRY}" "${@:3}"
unset BASHBOT_RETRY
fi
return
fi
# are not blocked, default curl and args are working
if [ -n "${BASHBOT_CURL_ARGS}" ] || [ "${BASHBOT_CURL}" != "curl" ]; then
# seems not blocked, try if blockrecover and default curl args working
elif [ -n "${BASHBOT_CURL_ARGS}" ] || [ "${BASHBOT_CURL}" != "curl" ]; then
printf "Problem with \"%s %s\"? retry %s with default config ...\n"\
"${BASHBOT_CURL}" "${BASHBOT_CURL_ARGS}" "$2"
BASHBOT_RETRY="2"; BASHBOT_CURL="curl"; BASHBOT_CURL_ARGS=""
_exec_if_function bashbotBlockRecover
sendJsonRetry "$2" "${BASHBOT_RETRY}" "${@:3}"
unset BASHBOT_RETRY
fi
[ -n "${BOTSENT[ERROR]}" ] && processError "$3" "${BOTSENT[ERROR]}" "$4" "" "${BOTSENT[DESCRIPTION]}" "$5" "$6"
fi
fi
} >>"${ERRORLOG}"