RunControllableTask now also properly catches Exceptions and reports them through the Future.
This commit is contained in:
parent
39ac8ef02d
commit
3820fb2600
1 changed files with 13 additions and 4 deletions
|
|
@ -34,14 +34,23 @@ public:
|
|||
return;
|
||||
}
|
||||
TaskControl control(this);
|
||||
try {
|
||||
result = this->task->run(control);
|
||||
if (!this->isCanceled()) {
|
||||
this->reportResult(result);
|
||||
}
|
||||
} catch (QException &e) {
|
||||
reportException(e);
|
||||
} catch (...) {
|
||||
reportException(QUnhandledException());
|
||||
}
|
||||
|
||||
this->reportFinished();
|
||||
}
|
||||
|
||||
private:
|
||||
T result;
|
||||
ControllableTask<T> *task;
|
||||
};
|
||||
|
||||
#endif // RUNCONTROLLABLETASK_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue