From 3d0bef92a1f318494711059707b7aad04cf9b7f0 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 7 May 2025 10:19:01 +0300 Subject: [PATCH] feat: compound the conncurent task error Signed-off-by: Trial97 --- launcher/tasks/ConcurrentTask.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/launcher/tasks/ConcurrentTask.cpp b/launcher/tasks/ConcurrentTask.cpp index 5cff93017..84530ec99 100644 --- a/launcher/tasks/ConcurrentTask.cpp +++ b/launcher/tasks/ConcurrentTask.cpp @@ -122,9 +122,24 @@ void ConcurrentTask::executeNextSubTask() emitSucceeded(); } else if (m_failed.count() == 1) { 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 { - 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;