QPromise::fail

Since: 0.1.0

QPromise<T>::fail(Function onRejected) -> QPromise<T>

Shorthand to promise.then(nullptr, onRejected), similar to the catch statement:

promise.fail([](const MyException&) {
    // {...}
}).fail(const QException&) {
    // {...}
}).fail(const std::exception&) {
    // {...}
}).fail() {
    // {...} catch-all
});
Last Updated: 9/9/2018, 8:55:07 AM