To remove the default CAF async error handlers on a page, invoke the following javascript:
CAF.Dialag.WarnAppender.stop();
CAF.Dialog.ErrorAppender.stop();
To add your own handler, invoke the following javascript:
Logger.addAppender(function(message, level, category) {
// custom handling logic here, for example:
// CAF.Dialog.warn(message)
}, Logger.WARN);
Following is an example handler that will refresh the page with a login screen if the user’s session has timed out, and do nothing (not display any error message) otherwise:
Logger.addAppender(function(message, level, category) {
if (message.match(/<form[^>]name\s=\s*[“‘][^’”]*login/i)) {
document.location.href = document.location.href + (document.location.href.indexOf(‘?’) == -1 ? ‘?’ : ‘&’); + “t=” + new Date().getTime();
}
}, Logger.WARN);
Note that as Mark said, MWS 7.1 will detect if the user’s session has timed out, and display a session timeout message and link to login page instead of a generic error message.</form[^>
#MWS-CAF-Task-Engine#webMethods#webMethods-BPMS