Instance Scan Linter Check Rhino Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I'm trying to create a linter check to scan for client scripts on a fresh Australia PDI but am always getting the following Failure.
Rhino error: missing ; before statement
I've stripped the linter check script to a barebones version to see if I still get the failure, and I do.
(function (engine) {
var TABLES_TO_CHECK = ["sys_script_client"];
if (TABLES_TO_CHECK.indexOf(String(engine.current.getTableName())) == -1) {
return;
}
gs.info(new GlideDateTime().getNumericValue() + " Current script being checked: " + engine.current.getValue("name") + " " + engine.current.sys_id);
})(engine);
Is there a way to print a stack trace to see what segment of code is causing this error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi there,
Don't see any error in the code visually, will try to reproduce on a PDI.
Is this just a test or what are you after with your check? Asking because seeing the tables_to_check, this is a very inefficient use of Instance Scan, since Linter Check will still run on every table with script fields. So instead of a table check that would run in a few seconds, this linter check will run for several minutes on larger instances or even time-out.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Just did a copy/past of your code, scan: no error.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field