isolated-vm icon indicating copy to clipboard operation
isolated-vm copied to clipboard

Ability to capture swallowed promise rejections/errors

Open ErkoKnoll opened this issue 1 year ago • 1 comments

Hi,

With a simple code of: new Promise(() => { }).then(() => { throw new Error('Swallowed error') });

a user can fire off a Promise, throw an error inside the promise chain without .catch method, and swallow the error.

I'm looking a way to capture these type of errors and print them out to the user, but the only option I can think of right now is to somehow wrap the underlying Promise implementation and add the special case.

I'm wondering if there are plans to add support for these cases, for example a global Isolate level callback that would get called every time such a case occurs so these cases can be easily captured.

ErkoKnoll avatar Jan 29 '24 16:01 ErkoKnoll