281 views

 

How to Handling error alerts due to Catalog Client Scripts in Service Portal?

Description


This article is for customers who have set up any Catalog Client Script containing g_form global methods, or some form of DOM manipulation in place, which are not supported in the Service Portal. Prior to the Jakarta version, the errors were just logged in the browser console, and the user did not even notice them. However, starting from Jakarta, if there is a catalog client script error, the Service Portal displays an error alert, which is good for sysadmin debugging, but not for end users.

 

 

Solution


Since these alerts cannot be turned off, here are some ways to circumvent them:

  • The simplest way to prevent this alert is by setting the UI type for client script to Desktop, this will only run the client script in Service Catalog and not in Service Portal.



  • If you are one of the customers that uses the same client script for Service Portal and Service Catalog, the other way is to use exception handling using try, catch block and logging the error in the console. Please see the following code sample explaining the same:
function onLoad() {
	
	try{
		var test = undefinedVar; //service catalog implementation throwing an error
	}catch(e){
		console.log(e);  //console.warn Works as well
	}
}

 

 

Applicable Versions


All

 

 

Article Information

Last Updated:2018-03-26 06:55:37
Published:2018-03-26