From 9b138eecbdf3d7291f7189b3191f8958520cc890 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Mon, 8 Jun 2020 17:36:42 +0200 Subject: [PATCH] fix/extend sendJson error handling --- bashbot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index 67daaf0..06ca514 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -11,7 +11,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.96-dev3-23-g02e776c +#### $$VERSION$$ v0.96-dev3-24-gb189191 # # Exit Codes: # - 0 sucess (hopefully) @@ -379,7 +379,8 @@ sendJsonResult(){ else if [ "${res}" != "" ]; then BOTSENT[ERROR]="$(JsonGetValue '"error_code"' <<< "${3}")" - BOTSENT[DESCRIPTION]="$(JsonGetValue '"description"' <<< "${3}")" + BOTSENT[DESCRIPTION]="$(JsonGetString '"description"' <<< "${3}")" + BOTSENT[RETRY]="$(JsonGetValue '"parameters","retry_after"' <<< "${3}")" else BOTSENT[ERROR]="999" BOTSENT[DESCRIPTION]="Timeout or broken/no connection"