mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-24 16:27:33 +00:00
bashbot: add error Pocessing to SendJsonRetry
This commit is contained in:
parent
f790d73e66
commit
4c4ba0ba5e
10
bashbot.sh
10
bashbot.sh
@ -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}"
|
||||
|
Loading…
Reference in New Issue
Block a user