feat: compound the conncurent task error
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
de541bf397
commit
3d0bef92a1
1 changed files with 17 additions and 2 deletions
|
@ -122,9 +122,24 @@ void ConcurrentTask::executeNextSubTask()
|
||||||
emitSucceeded();
|
emitSucceeded();
|
||||||
} else if (m_failed.count() == 1) {
|
} else if (m_failed.count() == 1) {
|
||||||
auto task = m_failed.keys().first();
|
auto task = m_failed.keys().first();
|
||||||
emitFailed(task->failReason());
|
auto reason = task->failReason();
|
||||||
|
if (reason.isEmpty()) { // clearly a bug somewhere
|
||||||
|
reason = tr("Task failed");
|
||||||
|
}
|
||||||
|
emitFailed(reason);
|
||||||
} else {
|
} else {
|
||||||
emitFailed(tr("One or more subtasks failed"));
|
QStringList failReason;
|
||||||
|
for (auto t : m_failed) {
|
||||||
|
auto reason = t->failReason();
|
||||||
|
if (!reason.isEmpty()) {
|
||||||
|
failReason << reason;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (failReason.isEmpty()) {
|
||||||
|
emitFailed(tr("Multiple subtasks failed"));
|
||||||
|
} else {
|
||||||
|
emitFailed(tr("Multiple subtasks failed\n%1").arg(failReason.join("\n")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue