CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ExceptionMessages.cc
Go to the documentation of this file.
6 
7 #include <string>
8 #include <sstream>
9 #include <iomanip>
10 
11 namespace edm {
12  void printCmsException(cms::Exception& e, edm::JobReport* jobRep, int rc) try {
13  std::string shortDesc("Fatal Exception");
14  std::ostringstream longDesc;
15  longDesc << e.explainSelf();
16  LogAbsolute(shortDesc) << "----- Begin " << shortDesc << " " << std::setprecision(0) << TimeOfDay()
17  << "-----------------------\n"
18  << longDesc.str() << "----- End " << shortDesc
19  << " -------------------------------------------------";
20  if (jobRep)
21  jobRep->reportError(shortDesc, longDesc.str(), rc);
22  } catch (...) {
23  }
24 
25  void printCmsExceptionWarning(char const* behavior, cms::Exception const& e) try {
26  std::string shortDesc(behavior);
27  shortDesc += " Exception";
28  std::ostringstream longDesc;
29  longDesc << e.explainSelf();
30  LogPrint(shortDesc) << "----- Begin " << shortDesc << " " << std::setprecision(0) << TimeOfDay()
31  << "-----------------------\n"
32  << longDesc.str() << "----- End " << shortDesc
33  << " -------------------------------------------------";
34  } catch (...) {
35  }
36 } // namespace edm
void printCmsException(cms::Exception &e, edm::JobReport *jobRep=nullptr, int rc=-1)
virtual std::string explainSelf() const
Definition: Exception.cc:108
Log< level::Warning, true > LogPrint
void reportError(std::string const &shortDesc, std::string const &longDesc, int const &exitCode)
Definition: JobReport.cc:493
Log< level::System, true > LogAbsolute
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)