2 ms·
«They run your code in a try/catch block and store the error away, and you have to remember yourself to manually throw it later.» Browser native Promises and t
by WorldMaker 11y ago
«They run your code in a try/catch block and store the error away, and you have to remember yourself to manually throw it later.»
Browser native Promises and their corresponding Dev Tools work exactly how you would expect and surface uncaught exceptions in Promises. Browsers that support async/await will especially be incentivized to provide strong asynchronous exception handling in their Dev Tools.
It's just tough to polyfill that behavior without bringing the JS synchronous code world to a halt. A good Promises library/polyfill will at least attempt to console.log uncaught exceptions when they happen.