Ignoring Request Exceptions if the user has left the page making the request
I am working on a web application where I am making several get requests for one page so the user can use a select components for filling up the page form. If the request is not finished before the user redirects to another page I get an exception that my get request was unsuccessful.
Is it possible to ignore exception logs if the request were abandoned by redirecting on another page during request executing ?
Well technically, because your getting the JavaScript exception then request actually completed and your code ran, "but" because you have removed the object references your the callback code triggered the exception.
So I see 2 possible options.
- In your calllback function check if you have "unloaded" / "cleared" and cause the code that is executing to just return
- You can add a telemetry initializer callback function (which will get called for every event -- including the exception) and you can check if the exception is the one you want to drop and simply return
falseto cause the event to be ignored and dropped.
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.