Open Bug 1839503 Opened 1 year ago Updated 1 year ago

awaiting rejected promise in console does not cause an error

Categories

(DevTools :: Console, defect, P3)

Firefox 115
defect

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.

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.

Component: Untriaged → Console
Product: Firefox → DevTools

I see now that this is a possible duplicate of

https://bugzilla.mozilla.org/show_bug.cgi?id=1839237

Component: Console → Untriaged
Product: DevTools → Firefox
Component: Untriaged → Console
Product: Firefox → DevTools
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Rejected promise does not cause an error in console → awaiting rejected promise in console does not cause an error
Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.