Please forgive my ignorant question in advance. I’m just trying to learn Sentry a little, so we can leverage it most efficiently.
Just curious, what is the benefit in reporting the error here (https://github.com/getsentry/raven-js/blob/d20940823e380f1e0672433b197f9944d61afeb3/dist/raven.js#L366) and not just re-throwing it.
This way either traceKitWindowOnError() will report it if
collectWindowErrors is set to ‘true’ or user defined onerror handler can deal with it.
We have a custom onerror handler that checks for common noisy errors from browser plugins/extensions and 3rd party vendors. We set
collectWindowErrors to false and only send to sentry what is actionable. Unfortunately, everything that was wrapped via _instrumentTryCatch() via install() still gets sent to Sentry.
Maybe our setup is not optimal and we are trying to fit a square peg into a round hole, but still just curious.