Created
November 11, 2015 09:12
-
-
Save gokulnath/ce9d8ed61c9b03d16f7e to your computer and use it in GitHub Desktop.
Recursive worklight http invoke
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
function invokeBackendHttp(input, count) { | |
// count is used for breaking recursion. | |
count = typeof(count) !== 'undefined' ? count : 0; | |
try { | |
count++; | |
var result = WL.Server.invokeHttp(input); | |
} | |
catch (e) { | |
if (count > 3) | |
return { message: 'Error in accessing bank resources.'} | |
WL.Logger.info("\n" + e.message + ":- This error occured during calling FCDB, retrying...."); | |
return invokeBackendHttp(input, count) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment