File indexing completed on 2024-04-06 12:12:44
0001 #include "FWCore/MessageLogger/interface/ExceptionMessages.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003 #include "FWCore/MessageLogger/interface/JobReport.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include "FWCore/Utilities/interface/TimeOfDay.h"
0006
0007 #include <string>
0008 #include <sstream>
0009 #include <iomanip>
0010
0011 namespace edm {
0012 void printCmsException(cms::Exception& e, edm::JobReport* jobRep, int rc) try {
0013 std::string shortDesc("Fatal Exception");
0014 std::ostringstream longDesc;
0015 longDesc << e.explainSelf();
0016 LogAbsolute(shortDesc) << "----- Begin " << shortDesc << " " << std::setprecision(0) << TimeOfDay()
0017 << "-----------------------\n"
0018 << longDesc.str() << "----- End " << shortDesc
0019 << " -------------------------------------------------";
0020 if (jobRep)
0021 jobRep->reportError(shortDesc, longDesc.str(), rc);
0022 } catch (...) {
0023 }
0024
0025 void printCmsExceptionWarning(char const* behavior, cms::Exception const& e) try {
0026 std::string shortDesc(behavior);
0027 shortDesc += " Exception";
0028 std::ostringstream longDesc;
0029 longDesc << e.explainSelf();
0030 LogPrint(shortDesc) << "----- Begin " << shortDesc << " " << std::setprecision(0) << TimeOfDay()
0031 << "-----------------------\n"
0032 << longDesc.str() << "----- End " << shortDesc
0033 << " -------------------------------------------------";
0034 } catch (...) {
0035 }
0036 }