2 #define TRACE_NAME "ExceptionHandler"
3 #include "ExceptionHandler.hh"
5 #include "canvas/Utilities/Exception.h"
6 #include "cetlib_except/exception.h"
9 #include <boost/exception/all.hpp>
15 if (optional_message !=
"")
17 TLOG(TLVL_ERROR) << optional_message;
24 catch (
const art::Exception& e)
26 TLOG(TLVL_ERROR) <<
"art::Exception object caught:" <<
27 " returnCode = " << std::to_string(e.returnCode()) <<
28 ", categoryCode = " << e.categoryCode() <<
29 ", category = " << e.category();
30 TLOG(TLVL_ERROR) <<
"art::Exception object stream:" << e;
34 catch (
const cet::exception& e)
36 TLOG(TLVL_ERROR) <<
"cet::exception object caught:" <<
41 catch (
const boost::exception& e)
43 TLOG(TLVL_ERROR) <<
"boost::exception object caught: " <<
44 boost::diagnostic_information(e);
48 catch (
const std::exception& e)
50 TLOG(TLVL_ERROR) <<
"std::exception caught: " << e.what();
56 TLOG(TLVL_ERROR) <<
"Exception of type unknown to artdaq::ExceptionHandler caught";
ExceptionHandlerRethrow
Controls whether the ExceptionHandler will rethrow after printing exception details.
Rethrow the exception after sending details to MessageFacility.
void ExceptionHandler(ExceptionHandlerRethrow decision, std::string optional_message)
The ExceptionHandler class prints out all available information about an excection, then optionally re-throws.