RunControllableTask now also properly catches Exceptions and reports them through the Future.

This commit is contained in:
eelke 2019-01-29 19:39:21 +01:00
parent 39ac8ef02d
commit 3820fb2600

View file

@ -34,14 +34,23 @@ public:
return;
}
TaskControl control(this);
result = this->task->run(control);
if (!this->isCanceled()) {
this->reportResult(result);
try {
result = this->task->run(control);
if (!this->isCanceled()) {
this->reportResult(result);
}
} catch (QException &e) {
reportException(e);
} catch (...) {
reportException(QUnhandledException());
}
this->reportFinished();
}
T result;
private:
T result;
ControllableTask<T> *task;
};
#endif // RUNCONTROLLABLETASK_H