3 ms·
I think you you (he?) needs RejectionEvent[0]. If that is so, it is a solved problem :) Basically, implementations log the error to the console and raise the P
by awalGarg 11y ago
I think you you (he?) needs RejectionEvent[0]. If that is so, it is a solved problem :)
Basically, implementations log the error to the console and raise the PotentiallyUnhandledRejection event if an error occurs inside a promise and no .catch handler was attached. If a .catch handler is attached _after_ the error is already logged, then a RejectionHandled event is raised. You can listen to those global events (the context is process in node, and window in browser, I think).
0: https://github.com/domenic/unhandled-rejections-browser-spec#the-promiserejectionevent-interface https://github.com/domenic/unhandled-rejections-browser-spec...