awaiting rejected promise in console does not cause an error
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: kalleg, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0
Steps to reproduce:
The issue can easily be reproduced.
Running this ...
await (async ()=>{ await Promise.resolve(); throw "Boom!"; })();
.. in the console
Actual results:
Running the command yields no "Uncaught (in promise) Boom!" error message in the console.
Expected results:
Running the command should yield an "Uncaught (in promise) Boom!" error message in the console, as in this example:
await ( async ()=>{ throw "Boom!"; })();
... which yields the expected error message.
Additional observations that might be useful:
The issue seems to be related to await:ing on an already resolved Promise.
Running this:
await ( async ()=>{
await new Promise(resolve => setTimeout(resolve, 1));
throw "Boom!";
})();
Yields the expected error message, but...
await ( async ()=>{
await new Promise(resolve => setTimeout(resolve, 0));
throw "Boom!";
})();
... does not.
As a reference, all the examples above yields an error message in Chrome.
I have tried with Nightly 116.0a1 as well, same issue.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 2•1 year ago
|
||
I see now that this is a possible duplicate of
Reporter | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Description
•