CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExceptionHelpers.cc
Go to the documentation of this file.
2 
6 
7 #include <cstring>
8 
9 namespace edm {
10 
11  void
12  addContextAndPrintException(char const* context,
13  cms::Exception& ex,
14  bool disablePrint) {
15  if (context != 0 && strlen(context) != 0U) {
16  ex.addContext(context);
17  }
18  if (!disablePrint) {
19  Service<JobReport> jobReportSvc;
20  if (jobReportSvc.isAvailable()) {
21  JobReport *jobRep = jobReportSvc.operator->();
22  edm::printCmsException(ex, jobRep, ex.returnCode());
23  }
24  else {
26  }
27  ex.setAlreadyPrinted(true);
28  }
29  }
30 }
void setAlreadyPrinted(bool value)
Definition: Exception.cc:255
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
bool isAvailable() const
Definition: Service.h:46
void addContext(std::string const &context)
Definition: Exception.cc:227
int returnCode() const
Definition: Exception.cc:199
void printCmsException(cms::Exception &e, edm::JobReport *jobRep=0, int rc=-1)