$treeview $search $mathjax $extrastylesheet
artdaq_core
v3_05_08a
$projectbrief
|
$projectbrief
|
$searchbox |
00001 00002 #define TRACE_NAME "ExceptionHandler" 00003 #include "ExceptionHandler.hh" 00004 00005 #include "canvas/Utilities/Exception.h" 00006 #include "cetlib_except/exception.h" 00007 #include "tracemf.h" 00008 00009 #include <boost/exception/all.hpp> 00010 00011 namespace artdaq { 00012 void ExceptionHandler(ExceptionHandlerRethrow decision, std::string optional_message) 00013 { 00014 if (optional_message != "") 00015 { 00016 TLOG(TLVL_ERROR) << optional_message; 00017 } 00018 00019 try 00020 { 00021 throw; 00022 } 00023 catch (const art::Exception& e) 00024 { 00025 TLOG(TLVL_ERROR) << "art::Exception object caught:" 00026 << " returnCode = " << e.returnCode() << ", categoryCode = " << e.categoryCode() << ", category = " << e.category(); 00027 TLOG(TLVL_ERROR) << "art::Exception object stream:" << e; 00028 00029 if (decision == ExceptionHandlerRethrow::yes) { throw; } 00030 } 00031 catch (const cet::exception& e) 00032 { 00033 TLOG(TLVL_ERROR) << "cet::exception object caught:" << e.explain_self(); 00034 00035 if (decision == ExceptionHandlerRethrow::yes) { throw; } 00036 } 00037 catch (const boost::exception& e) 00038 { 00039 TLOG(TLVL_ERROR) << "boost::exception object caught: " << boost::diagnostic_information(e); 00040 00041 if (decision == ExceptionHandlerRethrow::yes) { throw; } 00042 } 00043 catch (const std::exception& e) 00044 { 00045 TLOG(TLVL_ERROR) << "std::exception caught: " << e.what(); 00046 00047 if (decision == ExceptionHandlerRethrow::yes) { throw; } 00048 } 00049 catch (...) 00050 { 00051 TLOG(TLVL_ERROR) << "Exception of type unknown to artdaq::ExceptionHandler caught"; 00052 00053 if (decision == ExceptionHandlerRethrow::yes) { throw; } 00054 } 00055 } 00056 } // namespace artdaq