rxjs icon indicating copy to clipboard operation
rxjs copied to clipboard

Use `reportError` to deal with unhandled errors

Open benlesh opened this issue 3 years ago • 2 comments

I knew this API was coming, and we want to keep an eye on it.

What/Why

reportError is something we probably want to switch to. It reports the error synchronously to window.onerror. This is a minor advantage over the setTimeout trick we're currently doing, as it's more deterministic.

Current Issues

Currently, it's not going to work for us for a couple of reasons:

  1. It's not available in Safari or Node.
  2. We have some logic around config.onUnhandledError that we call in a setTimeout if it exists. It currently doesn't check that it exists until the timeout fires, and changing that would be a breaking change. We'd need to check for the existence of onUnhandledError synchronously before we could attempt to use reportError if it existed. If it didn't exist, we'd need to use the setTimeout trick.

benlesh avatar Feb 04 '22 22:02 benlesh

Core Team: Waiting on Node to stabilize their decision on this. (cc @benjamingr, who I think is working on getting this in Node)

benlesh avatar Feb 23 '22 21:02 benlesh

@benjamingr Has there been any movement here?

benlesh avatar Aug 24 '22 20:08 benlesh