The following call to a MobiLink system procedure registers a Java method called handleError as the script for the handle_error
connection event when synchronizing the script version ver1.
The following is the sample Java method handleError. It processes an error based on the data that is passed in. It also determines
the resulting error code.
public String handleError(
ianywhere.ml.script.InOutInteger actionCode,
int errorCode,
String errorMessage,
String user,
String table)
{
int new_ac;
if (user == null) {
new_ac = handleNonSyncError(errorCode, errorMessage);
} else if (table == null) {
new_ac = handleConnectionError(errorCode, errorMessage, user);
}
else {
new_ac = handleTableError(errorCode, errorMessage, user, table);
}
// Keep the most serious action code.
if (actionCode.getValue() < new_ac) {
actionCode.setValue(new_ac);
}
}