patriksimek / vm2

Advanced vm/sandbox for Node.js
MIT License
3.87k stars 295 forks source link

Better asynchronous code errors handling #441

Open ppedziwiatr opened 2 years ago

ppedziwiatr commented 2 years ago

Hey,

is there a chance of adding a better errors handling for the async code? I.e. such that would not require adding global handler for uncaughtException or unhandledRejection?

Adding such global handler causes that some errors, that in fact should cause the system to crash and be fixed asap (the "fail fast" principle) will be swallowed...

XmiliaH commented 2 years ago

It should be possible to add an uncaughtException handler. However, I do not have good ideas of how to implement an unhandledRejection handler.