Skip to content

Commit 7763497

Browse files
committed
DPL: improve error message on failed topological sort
1 parent 1856ab5 commit 7763497

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,19 @@ int doMain(int argc, char** argv, o2::framework::WorkflowSpec const& workflow,
24282428
if (checkDependencies(j, i)) {
24292429
edges.emplace_back(i, j);
24302430
if (both) {
2431-
throw std::runtime_error(physicalWorkflow[i].name + " has circular dependency with " + physicalWorkflow[j].name);
2431+
std::ostringstream str;
2432+
for (auto x : {i, j}) {
2433+
str << physicalWorkflow[x].name << ":\n";
2434+
str << "inputs:\n";
2435+
for (auto& input : physicalWorkflow[x].inputs) {
2436+
str << fmt::format("- {}\n", input);
2437+
}
2438+
str << "outputs:\n";
2439+
for (auto& output : physicalWorkflow[x].outputs) {
2440+
str << fmt::format("- {}\n", output);
2441+
}
2442+
}
2443+
throw std::runtime_error(physicalWorkflow[i].name + " has circular dependency with " + physicalWorkflow[j].name + ":\n" + str.str());
24322444
}
24332445
}
24342446
}

0 commit comments

Comments
 (0)