diff --git a/core/RunControllableTask.h b/core/RunControllableTask.h index 6cca6ae..e696334 100644 --- a/core/RunControllableTask.h +++ b/core/RunControllableTask.h @@ -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 *task; }; + #endif // RUNCONTROLLABLETASK_H