CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
14  std::string shortDesc("Fatal Exception");
15  std::ostringstream longDesc;
16  longDesc << e.explainSelf();
17  LogAbsolute(shortDesc)
18  << "----- Begin " << shortDesc << " "
19  << std::setprecision(0) << TimeOfDay()
20  << "-----------------------\n"
21  << longDesc.str()
22  << "----- End " << shortDesc << " -------------------------------------------------";
23  if(jobRep) jobRep->reportError(shortDesc, longDesc.str(), rc);
24  } catch(...) {
25  }
26 
27  void
28  printCmsExceptionWarning(char const* behavior, cms::Exception const& e) try {
29  std::string shortDesc(behavior);
30  shortDesc += " Exception";
31  std::ostringstream longDesc;
32  longDesc << e.explainSelf();
33  LogPrint(shortDesc)
34  << "----- Begin " << shortDesc << " "
35  << std::setprecision(0) << TimeOfDay()
36  << "-----------------------\n"
37  << longDesc.str()
38  << "----- End " << shortDesc << " -------------------------------------------------";
39  } catch(...) {
40  }
41 }
virtual std::string explainSelf() const
Definition: Exception.cc:146
void reportError(std::string const &shortDesc, std::string const &longDesc, int const &exitCode)
Definition: JobReport.cc:585
void printCmsException(cms::Exception &e, edm::JobReport *jobRep=0, int rc=-1)
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)