Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P2: Important
-
Resolution: Done
-
Affects Version/s: 5.12.5, 5.13.0
-
Fix Version/s: 5.13.2, 5.14.0 Beta 1
-
Component/s: QML: Declarative and Javascript Engine
-
Labels:
-
Commits:36be27265d61c76b25417a25e482030e30ff380f (qt/qtdeclarative/5.13)
Description
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.