mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-07 17:57:39 +08:00
- 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.
22 lines
504 B
Markdown
22 lines
504 B
Markdown
# QPromiseUndefinedException
|
|
|
|
*Since: 0.5.0*
|
|
|
|
This exception is thrown when rejecting a promise with no explicit reason, for example:
|
|
|
|
```cpp
|
|
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!
|
|
})
|
|
```
|