ExceptionCollector.cc
Go to the documentation of this file.
2 
3 #include <cassert>
4 
5 using namespace art;
6 
7 namespace {
9  exception_msg_from_ptr(std::exception_ptr const eptr) try {
10  std::rethrow_exception(eptr);
11  }
12  catch (std::exception const& e) {
13  return e.what();
14  }
15 } // namespace
16 
17 [[noreturn]] void
19 {
20  assert(!empty());
22  for (auto const e : exceptions_) {
23  message += exception_msg_from_ptr(e);
24  }
25  exceptions_.clear();
26  throw collected_exception{move(message)};
27 }
std::string string
Definition: nybbler.cc:12
const double e
def move(depos, offset)
Definition: depos.py:107
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:97