ASP.NET Ajax Control Toolkit - capturing unhandled exceptions?

241 Views Asked by At

I inherited an ASP.NET (.NET 4.7.2) application. It has Elastic rigged-up (via the Javascript API) to capture APM data and errors from the front-end.

The top offending errors in Elastic for months now have been:

  1. Uncaught Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.
  2. Uncaught Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404 (but sometimes it will say 503).

Both refer to ScriptResource.axd as being the "culprit".

On the one hand, it sure would be nice if I could find out exactly WHAT resource or URL was being requested... as well as which page in my app is doing the requesting.... when such an error occurs.

But I'm at the point now where... as an alternative, I'd just be happy to change these from being unhandled exceptions to handled ones. (I don't think our users are actually having any serious issues from these. The major page for this app is one that updates a couple of key update panels once every 8 seconds. So, occasional failures of those requests are somewhat expected. Users would have already raised hell if something major was going on.)

I'd much rather see any errors in Elastic that are coming from our own Javascript code than from the Ajax Control Toolkit.

So, does anyone know how I might capture these?

1

There are 1 best solutions below

0
DaveyBoy On

I THINK I've finally found the right information (though some of these pages are from 2008). How to basically add a custom error handler to the Script Manager:

Script Manager 4.5 handling errors

https://social.msdn.microsoft.com/Forums/en-US/59a34e36-f80b-4344-a793-8ea2ce21abe2/ajax-exception-handling?forum=aspdotnetajax

Handle Asynch error messages with ScriptManager

https://blog.digitaltools.com/post/2010/02/03/Unhide-Exceptions-Hidden-By-AJAX.aspx

Looks like I should be able to either bury the exceptions... or get more details on them and pass them on through to get thrown to Elastic.

I think my biggest hurdle right now would be to actually try to recreate these errors myself (preferably in a non-prod environment). But I guess I'll figure that out somehow.

Thanks!