Files
qtpromise/docs/qtpromise/exceptions/undefined.md
Simon Brunel 3c1461b8d0 Enhance the documentation and add markdown lint
- Add npm package.json to make easier maintaining dependencies.
- Make markdown files consistent using remark.
- Wrap markdown lines to 100 characters.
- Better README.md layout and visual.
- Enable VuePress landing/home page.
- Upgrade to latest VuePress version.
- Add link to the new Qt Marketplace.
2019-12-21 10:27:26 +01:00

504 B

QPromiseUndefinedException

Since: 0.5.0

This exception is thrown when rejecting a promise with no explicit reason, for example:

QPromise<int> promise([](const QPromiseResolve<int>& resolve, const QPromiseReject<int>& reject) {
    async_method([=](bool success, int result) {
        if (success) {
            resolve(result);
        } else {
            reject();
        }
    });
});

promise.fail([](const QPromiseUndefinedException&) {
    // promise rejected without reason!
})