FWCore
Framework
src
ExceptionHelpers.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ExceptionHelpers.h
"
2
3
#include "
FWCore/MessageLogger/interface/ExceptionMessages.h
"
4
#include "
FWCore/MessageLogger/interface/JobReport.h
"
5
#include "
FWCore/ServiceRegistry/interface/Service.h
"
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
) != 0
U
) {
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
{
21
edm::printCmsException
(ex);
22
}
23
ex.
setAlreadyPrinted
(
true
);
24
}
25
}
26
}
// namespace edm
cms::Exception::setAlreadyPrinted
void setAlreadyPrinted(bool value)
Definition:
Exception.cc:179
edm::printCmsException
void printCmsException(cms::Exception &e, edm::JobReport *jobRep=nullptr, int rc=-1)
Definition:
ExceptionMessages.cc:12
cms::Exception::returnCode
int returnCode() const
Definition:
Exception.cc:151
edm::Service
Definition:
Service.h:30
edm::JobReport
Definition:
JobReport.h:103
edm::addContextAndPrintException
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
Definition:
ExceptionHelpers.cc:11
mitigatedMETSequence_cff.U
U
Definition:
mitigatedMETSequence_cff.py:36
ExceptionHelpers.h
JobReport.h
Service.h
visDQMUpload.context
context
Definition:
visDQMUpload.py:30
ExceptionMessages.h
cms::Exception
Definition:
Exception.h:70
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
Generated for CMSSW Reference Manual by
1.8.14