When connecting to a data connection, developer may want to setup fail-and-retry logic. When main connection fails, backup connection is used.
How to achieve it?
Setting errormode to 0 can force script continue after a failure.
The code will look like this:
//Suppress reload failure in case of connection failure
Set errormode = 0;
//Connect to the main Connection
LIB CONNECT TO 'MainConnection';
//Evaluate error code
LET tempErrorDetails = ScriptErrorDetails;
IF Len(tempErrorDetails) > 0 THEN
// If there is an error connecting to this connection
trace ERROR: $(tempErrorDetails);
LIB CONNECT TO 'backupConnection';
//Resume error mode
Set errormode = 1;
// Load Script Start
// Load Script End
Sample QVF is also attached. Please modify the sample code in it accordingly before using.