LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ExceptionCollector.cc
Go to the documentation of this file.
2 
3 #include <cassert>
4 
5 using namespace art;
6 
7 namespace {
8  std::string
9  exception_msg_from_ptr(std::exception_ptr const eptr)
10  try {
11  std::rethrow_exception(eptr);
12  }
13  catch (std::exception const& e) {
14  return e.what();
15  }
16 } // namespace
17 
18 [[noreturn]] void
20 {
21  assert(!empty());
22  std::string message;
23  for (auto const& e : exceptions_) {
24  message += exception_msg_from_ptr(e);
25  }
26  exceptions_.clear();
27  throw collected_exception{std::move(message)};
28 }
void message(RunManager *runmanager)
Definition: ts_scorers.cc:74
Definition: MVAAlg.h:12
Float_t e
Definition: plot.C:35
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109