Created
March 14, 2022 19:26
-
-
Save hurrifan1/46bc35d2b785fc8f1e21d49e361acb33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* REST error retry loop */ | |
/* - This script will try to execute a subroutine 3 times before it finally fails. */ | |
Set ErrorMode = 0; | |
SUB MySub | |
LIB CONNECT TO 'Server test'; | |
[MyTable]: | |
SQL SELECT | |
"image", | |
"theme", | |
"username" | |
FROM JSON (wrap on) "root"; | |
END SUB | |
Set ScriptErrorCount = 0; | |
Call MySub | |
DO UNTIL $(ScriptErrorCount) = 0 | |
Let currError = $(ScriptErrorCount); | |
Trace % % % % ERROR CODE MySub #$(ScriptErrorCount): $(ScriptError); | |
Sleep 3000; | |
Call MySub | |
if $(ScriptErrorCount) = 2 then; Set ErrorMode = 1; end if; | |
Let vMath = $(ScriptErrorCount) - 1; | |
Exit Do UNLESS $(currError) = $(vMath); | |
LOOP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment