Skip to content

Instantly share code, notes, and snippets.

@gokulnath
Created November 11, 2015 09:12
Show Gist options
  • Save gokulnath/ce9d8ed61c9b03d16f7e to your computer and use it in GitHub Desktop.
Save gokulnath/ce9d8ed61c9b03d16f7e to your computer and use it in GitHub Desktop.
Recursive worklight http invoke
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