tests/auto/qml/qqmlpromise/data/promisehandlerthrows.qml
raw| 1 | import QtQuick 2.12 |
| 2 | |
| 3 | Item { |
| 4 | id: root |
| 5 | property string errorMessage |
| 6 | Component.onCompleted: () => { |
| 7 | let prom = Promise.reject("Some error") |
| 8 | .then( |
| 9 | o => {console.log("Never reached");}, |
| 10 | err => { |
| 11 | console.log("Rethrowing err"); |
| 12 | throw err; |
| 13 | } |
| 14 | ) |
| 15 | .catch(err => root.errorMessage = err) |
| 16 | } |
| 17 | } |