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>
14 if (optional_message !=
"")
16 TLOG(TLVL_ERROR) << optional_message;
23 catch (
const art::Exception& e)
25 TLOG(TLVL_ERROR) <<
"art::Exception object caught:"
26 <<
" returnCode = " << e.returnCode() <<
", categoryCode = " << e.categoryCode() <<
", category = " << e.category();
27 TLOG(TLVL_ERROR) <<
"art::Exception object stream:" << e;
31 catch (
const cet::exception& e)
33 TLOG(TLVL_ERROR) <<
"cet::exception object caught:" << e.explain_self();
37 catch (
const boost::exception& e)
39 TLOG(TLVL_ERROR) <<
"boost::exception object caught: " << boost::diagnostic_information(e);
43 catch (
const std::exception& e)
45 TLOG(TLVL_ERROR) <<
"std::exception caught: " << e.what();
51 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.