Skip to content

Commit 55f6f19

Browse files
committed
mini-daq: better handling and reporting of daq startup errors
1 parent befc7e5 commit 55f6f19

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

extras/mini-daq/src/mini_daq_main.cc

+14-2
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,22 @@ int main(int argc, char *argv[])
497497

498498
spdlog::info("Starting readout. Running for {} seconds.", timeToRun.count());
499499

500-
if (auto ec = rdo.start(timeToRun))
500+
if (auto ec = rdo.start(timeToRun, initOptions))
501501
{
502502
cerr << "Error starting readout: " << ec.message() << endl;
503-
throw std::runtime_error("ReadoutWorker error");
503+
504+
auto initResults = rdo.getInitResults();
505+
506+
for (const auto &cmdResult: initResults.init)
507+
{
508+
if (cmdResult.ec)
509+
{
510+
std::cerr << fmt::format(" Error during DAQ init sequence: cmd={}, ec={}\n",
511+
to_string(cmdResult.cmd), cmdResult.ec.message());
512+
}
513+
}
514+
515+
throw std::runtime_error("DAQ startup start error");
504516
}
505517

506518
MiniDaqCountersUpdate counters;

0 commit comments

Comments
 (0)