mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-02 07:15:25 +08:00
- Fix the wrong lambda format (missing `[]`). - Make consistent argument naming (`error`). - Use `const &` when appropriated.
18 lines
471 B
Markdown
18 lines
471 B
Markdown
# QPromiseCanceledException
|
|
|
|
*Since: 0.1.0*
|
|
|
|
This exception is thrown for promise created from a [`QFuture`](../qtconcurrent.md) which has been
|
|
canceled (e.g. using [`QFuture::cancel()`](http://doc.qt.io/qt-5/qfuture.html#cancel)), for example:
|
|
|
|
```cpp
|
|
auto output = QtPromise::resolve(future)
|
|
.fail([](const QPromiseCanceledException& error) {
|
|
// `future` has been canceled!
|
|
});
|
|
```
|
|
|
|
::: tip NOTE
|
|
QtPromise doesn't support promise cancelation (yet?)
|
|
:::
|