-
Notifications
You must be signed in to change notification settings - Fork 423
Description
👋
I have some fetch
calls that are using AbortController
(MDN) to cancel while they are in-flight. When this happens, a DomException
error is raised, but generally clients want to catch it and ignore.
Since rack-mini-profiler patches fetch
(see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/lib/html/includes.js#L936-L991), I can sometimes get raw Uncaught (in promise) DOMException: The user aborted a request.
exceptions from the mini-profiler Javascript if I create and abort many fetches in quick succession.
I was able to make the errors go away by tacking on a catch(e => {})
to the Promise chain here, but wasn't sure if that was a good long-term fix.
Generally not a huge deal, but this will cause problems when deployed to non-development environments that have clientside JS error tracking services and was really confusing when developing to see unhandled errors (that our application was explicitly handling).
Any guidance on how to address this in the library or maybe even opt out of the fetch
tracking behavior (I'd rather not have the metrics for JS request vs potential errors)?