Code: Select all
try {
system.securityManager.logon([["",fields.username],["",hashedPassword]]);
} catch (e) {
// Parse the error message
var errormsg=String(e);
// Remove this string from the beginning of the error message
errormsg=errormsg.substring("JavaException: com.ebasetech.xi.exceptions.LogonException: ".length);
alert(errormsg);
event.stopExecution();
}
Code: Select all
try {
if ( tables.USERS.rowCount > 0 ) {
// Logon was successfull
} else {
fields.ERRORCODE.value = "999991";
fields.ERRORDESCRIPTION.value = "Your username or password is not correct";
print("Login failed with the username " + fields.PARAM1_VALUE.value);
}
} catch (e) {
fields.USERID.value = null;
fields.ERRORCODE.value = "999991";
fields.ERRORDESCRIPTION.value = "Your username or password is not correct";
}
Is there a way to prevent this error message from being printed to the console ?
I want to only display my custom error message (which is above) which tells me the username that was used to attempt to log in.