Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

How does one error a AsyncFuture::Deferred? #35

Open
remster opened this issue Apr 24, 2020 · 1 comment
Open

How does one error a AsyncFuture::Deferred? #35

remster opened this issue Apr 24, 2020 · 1 comment

Comments

@remster
Copy link

remster commented Apr 24, 2020

And how does one communicate that error?
Is this what 'cancel' is for? - doesn't sound this way as cancel is the interface of the future not of the promise.

And a related question, having a failed QFuture - how does one "rescue" it? - i.e.: having this chain:
return observe(reading).subscribe(updateCache).future(); - suppose reading fails and suppose there is a way of correcting it:
return observe(reading).subscribe(updateCache, rescue).future();
the above doesn't work.

@vpicaver
Copy link
Contributor

There's currently no error handling in AsyncFuture. You can handle errors in the QFuture type using std::variant or std::any. With Qt6 QFuture can handle failures with exceptions. I'm not sure if Qt6's QFuture is compatible with AsyncFuture. There's a bunch of feature overlap. But QFuture doesn't support combine().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants