How to use try catch in ServiceNow Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2016 10:58 PM
I attended Steve Bell's advanced GlideRecord session at K16 and I believe there was an incidental comment made about how to properly implement exception handling in SN scripts. However, I made no note of it and cannot remember exactly what the instructions were. I believe there was something said about a property that needed to be set...
Anybody who knows the answer to this, please let me know.
As it is now, try catch is ignored and the script just dies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2018 03:03 AM
If it helps, the K16 Lab documentation mentioned can be found here:
Advanced GlideRecord Scripting (repeat 1 of 2)
Advanced GlideRecord Scripting (repeat 2 of 2)
Some really useful guidance in these.
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2018 09:14 AM
on this blast from the past, I can say my main issue was a lack of understanding on exactly what causes errors to be thrown in js. Here's a nice reference I found:
Exceptional Exception Handling in JavaScript — SitePoint