Is there a way to preserve client side errors?

bonsai
Mega Sage

If an error occurs on the client side, such as in a client script or UI page, where are the errors recorded?

I think there are logs that are recorded in the browser, but are there any that are recorded in a table?

I recently found something called a client transaction log, so I wondered if I could find out client error information as well.

I considered using "GlideAjax" as a way to save it somewhere, but I would like to know if there is a table that records it OOTB.
Or I would also like to know if there is a way to save it as a browser function.

7 REPLIES 7

Omkar Mone
Mega Sage

If extensive logging is required, you can create a new table to store the error details. By using GlideAjax, you can send the error information to the server and store it in the table whenever an error occurs. Additionally, since client scripts run in the browser, any errors will be logged in the browser console.

Juhi Poddar
Kilo Patron

Hello @bonsai 

By default, client-side errors, such as those from client scripts or UI pages, are not recorded in a ServiceNow table out-of-the-box (OOTB). These errors are typically logged in the browser's developer console.

They can be accessed by pressing Ctrl+Shift+J (on Windows/Linux) or Cmd+Option+J (on macOS) and navigating to the Console tab.

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

Hello @bonsai 

Glad that the response helped you.

Can you also mark it as an accepted solution so that it help future readers to locate the solution easily in community.

 

Thank You

Juhi Poddar

Uncle Rob
Kilo Patron

To understand Client Side vs Server Side capability, I'm fond of the galaxy scale metaphor.
Lets say the ServiceNow data center was 2 lightyears away.  Your browser is sitting with you on earth.
ANYTHING you do to transact with the database is MINIMUM a 2 year wait, but possibly 4 (if you need to wait for the Server to answer).

Client side BY ITS NATURE is at your browser, not at the server.  So if logging is absolutely required, you've got to capture events and send them to the database.

But to do that, you MUST use GlideAjax.  GlideAjax is asynchronous, which basically means "I don't care to wait for any message that comes back from the server".  In our galactic metaphor, that's 2 lightyears, and not 4.

That's a pretty heavy build, so be absolutely sure the use case justifies the tech debt.