-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.5, 5.13.0
-
36be27265d61c76b25417a25e482030e30ff380f (qt/qtdeclarative/5.13)
I'm facing a bug in Qt's Promise implementation. Exceptions thrown from the second argument of Promise.prototype.then()'s argument aren't propagated to the following .catch() statement.
I have a simple test case:
Promise.reject("Some error") .then( o => console.log("Never reached"), err => { console.log("Rethrowing err"); throw err; } ) .catch(err => { console.error("The error is: " + err); });
This is what it should print:
Rethrowing err The error is: Some error
and it does so under Node.js and Mozilla Firefox.
However, it only prints the first line under Qt, because the .catch() part isn't run at all.
| For Gerrit Dashboard: QTBUG-78554 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 274711,3 | QMLJS: Fix exception handling in promises | 5.13 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 293888,1 | QMLJS: Fix exception handling in promises | 5.12 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |