CMS 3D CMS Logo

ExceptionHelpers.cc
Go to the documentation of this file.
2 
6 
7 #include <cstring>
8 
9 namespace edm {
10 
11  void addContextAndPrintException(char const* context, cms::Exception& ex, bool disablePrint) {
12  if (context != nullptr && strlen(context) != 0U) {
13  ex.addContext(context);
14  }
15  if (!disablePrint) {
16  Service<JobReport> jobReportSvc;
17  if (jobReportSvc.isAvailable()) {
18  JobReport* jobRep = jobReportSvc.operator->();
19  edm::printCmsException(ex, jobRep, ex.returnCode());
20  } else {
22  }
23  ex.setAlreadyPrinted(true);
24  }
25  }
26 } // namespace edm
cms::Exception::addContext
void addContext(std::string const &context)
Definition: Exception.cc:165
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
Service.h
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
ExceptionMessages.h
edm::Service
Definition: Service.h:30
edm::addContextAndPrintException
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
Definition: ExceptionHelpers.cc:11
cms::Exception::returnCode
int returnCode() const
Definition: Exception.cc:151
ExceptionHelpers.h
cms::Exception
Definition: Exception.h:70
JobReport.h
edm::printCmsException
void printCmsException(cms::Exception &e, edm::JobReport *jobRep=nullptr, int rc=-1)
Definition: ExceptionMessages.cc:12
cms::Exception::setAlreadyPrinted
void setAlreadyPrinted(bool value)
Definition: Exception.cc:179
edm::JobReport
Definition: JobReport.h:103