- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2024 09:26 PM
I would like to create a process that detects when an error occurs in a UI page, UI policy, or client script.
I know that you can use "try~catch" to catch errors, but is there a way to implement this in a single client script or the like to detect errors in the browser?
I considered incorporating "try~catch" into the client-side processing, but if there is a common error collection process, I would like to implement it.
I would like to be able to catch error events, etc.
Alternatively, if I could catch some kind of event and constantly determine errors, I think I could record browser errors.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2024 09:29 PM
the only possible way is to use try catch block and if you wish to log it in system logs then within the catch block you can use GlideAjax to write to add it in system logs using gs.info()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2024 12:45 AM
As discussed in previous threads and reiterated by Ankur in his response, this functionality isn't possible without using GlideAjax to log errors in a log table. Additionally, as I mentioned in one of your earlier queries, you can create a custom log table if extensive logging is required. I recommend developing a generic LogUtil Script Include that can be called from any client script in the future.
Hope this helps!