FWCore
Utilities
src
EDMException.cc
Go to the documentation of this file.
1
2
#include "
FWCore/Utilities/interface/EDMException.h
"
3
4
#define FILLENTRY(name) \
5
{ name, #name }
6
7
namespace
edm
{
8
namespace
errors
{
9
static
const
std::map<ErrorCodes, std::string>
codeMap
= {
FILLENTRY
(
CommandLineProcessing
),
10
FILLENTRY
(
ConfigFileNotFound
),
11
FILLENTRY
(
ConfigFileReadError
),
12
FILLENTRY
(
OtherCMS
),
13
FILLENTRY
(
StdException
),
14
FILLENTRY
(
Unknown
),
15
FILLENTRY
(
BadAlloc
),
16
FILLENTRY
(
BadExceptionType
),
17
FILLENTRY
(
ProductNotFound
),
18
FILLENTRY
(
DictionaryNotFound
),
19
FILLENTRY
(
NoProductSpecified
),
20
FILLENTRY
(
InsertFailure
),
21
FILLENTRY
(
Configuration
),
22
FILLENTRY
(
LogicError
),
23
FILLENTRY
(
UnimplementedFeature
),
24
FILLENTRY
(
InvalidReference
),
25
FILLENTRY
(
NullPointerError
),
26
FILLENTRY
(
EventTimeout
),
27
FILLENTRY
(
EventCorruption
),
28
FILLENTRY
(
ScheduleExecutionFailure
),
29
FILLENTRY
(
EventProcessorFailure
),
30
FILLENTRY
(
FileInPathError
),
31
FILLENTRY
(
FileOpenError
),
32
FILLENTRY
(
FileReadError
),
33
FILLENTRY
(
FatalRootError
),
34
FILLENTRY
(
MismatchedInputFiles
),
35
FILLENTRY
(
ProductDoesNotSupportViews
),
36
FILLENTRY
(
ProductDoesNotSupportPtr
),
37
FILLENTRY
(
NotFound
),
38
FILLENTRY
(
FormatIncompatibility
),
39
FILLENTRY
(
FallbackFileOpenError
),
40
FILLENTRY
(
NoSecondaryFiles
),
41
FILLENTRY
(
ExceededResourceVSize
),
42
FILLENTRY
(
ExceededResourceRSS
),
43
FILLENTRY
(
ExceededResourceTime
),
44
FILLENTRY
(
FileWriteError
),
45
FILLENTRY
(
FileNameInconsistentWithGUID
),
46
FILLENTRY
(
EventGenerationFailure
),
47
FILLENTRY
(
CaughtSignal
)};
48
static
const
std::string
kUnknownCode
(
"unknownCode"
);
49
}
// namespace errors
51
52
const
std::string
&
Exception::codeToString
(
errors::ErrorCodes
c
) {
53
auto
i
(
errors::codeMap
.
find
(
c
));
54
return
i
!=
errors::codeMap
.end() ?
i
->second :
errors::kUnknownCode
;
55
}
56
57
Exception::Exception
(
errors::ErrorCodes
aCategory) :
cms
::
Exception
(codeToString(aCategory)), category_(aCategory) {}
58
59
Exception::Exception
(
errors::ErrorCodes
aCategory,
std::string
const
& message)
60
:
cms
::
Exception
(codeToString(aCategory), message), category_(aCategory) {}
61
62
Exception::Exception
(
errors::ErrorCodes
aCategory,
char
const
* message)
63
:
cms
::
Exception
(codeToString(aCategory),
std
::
string
(message)), category_(aCategory) {}
64
65
Exception::Exception
(
errors::ErrorCodes
aCategory,
std::string
const
& message,
cms::Exception
const
& another)
66
:
cms
::
Exception
(codeToString(aCategory), message, another), category_(aCategory) {}
67
68
Exception::Exception
(
errors::ErrorCodes
aCategory,
char
const
* message,
cms::Exception
const
& another)
69
:
cms
::
Exception
(codeToString(aCategory),
std
::
string
(message), another), category_(aCategory) {}
70
71
Exception::Exception
(
Exception
const
&
other
) :
cms
::
Exception
(
other
), category_(
other
.category_) {}
72
73
Exception::~Exception
() noexcept {}
74
75
Exception
&
Exception::operator=
(
Exception
const
&
other
) {
76
Exception
temp
(
other
);
77
this->
swap
(temp);
78
return
*
this
;
79
}
80
81
int
Exception::returnCode_
()
const
{
return
static_cast<int>(
category_
); }
82
83
void
Exception::throwThis
(
errors::ErrorCodes
aCategory,
84
char
const
* message0,
85
char
const
* message1,
86
char
const
* message2,
87
char
const
* message3,
88
char
const
* message4) {
89
Exception
e
(aCategory,
std::string
(message0));
90
e
<< message1 << message2 << message3 << message4;
91
throw
e
;
92
}
93
94
void
Exception::throwThis
(
errors::ErrorCodes
aCategory,
char
const
* message0,
int
intVal,
char
const
* message1) {
95
Exception
e
(aCategory,
std::string
(message0));
96
e
<< intVal << message1;
97
throw
e
;
98
}
99
100
Exception
*
Exception::clone
()
const
{
return
new
Exception
(*
this
); }
101
102
void
Exception::rethrow
() {
throw
*
this
; }
103
}
// namespace edm
edm::errors::MismatchedInputFiles
Definition:
EDMException.h:52
mps_fire.i
i
Definition:
mps_fire.py:428
edm::Exception::category_
Code category_
Definition:
EDMException.h:115
edm::errors::InvalidReference
Definition:
EDMException.h:39
edm::errors::ConfigFileNotFound
Definition:
EDMException.h:24
edm::errors::EventTimeout
Definition:
EDMException.h:42
edm::errors::LogicError
Definition:
EDMException.h:37
edm::errors::ProductDoesNotSupportPtr
Definition:
EDMException.h:55
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::errors::EventCorruption
Definition:
EDMException.h:43
edm::errors::FileWriteError
Definition:
EDMException.h:66
edm::errors::CaughtSignal
Definition:
EDMException.h:72
edm::errors::EventGenerationFailure
Definition:
EDMException.h:70
edm::Exception::Exception
Exception(Code category)
Definition:
EDMException.cc:57
edm::errors::Unknown
Definition:
EDMException.h:29
edm::errors::ErrorCodes
ErrorCodes
Definition:
EDMException.h:22
edm::Exception::operator=
Exception & operator=(Exception const &other)
Definition:
EDMException.cc:75
edm::errors::BadExceptionType
Definition:
EDMException.h:31
edm::errors::NoSecondaryFiles
Definition:
EDMException.h:60
edm::errors::FileInPathError
Definition:
EDMException.h:48
FILLENTRY
#define FILLENTRY(name)
Definition:
EDMException.cc:4
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition:
FindCaloHit.cc:19
edm::errors::NotFound
Definition:
EDMException.h:57
groupFilesInBlocks.temp
list temp
Definition:
groupFilesInBlocks.py:142
edm::errors::FileOpenError
Definition:
EDMException.h:49
edm::Exception
Definition:
EDMException.h:77
EDMException.h
edm::errors::ProductNotFound
Definition:
EDMException.h:33
edm::errors::NullPointerError
Definition:
EDMException.h:40
edm::errors::ProductDoesNotSupportViews
Definition:
EDMException.h:54
edm::Exception::clone
Exception * clone() const override
Definition:
EDMException.cc:100
errors
Definition:
errors.py:1
edm::errors::FatalRootError
Definition:
EDMException.h:51
edm::errors::kUnknownCode
static const std::string kUnknownCode("unknownCode")
edm::errors::DictionaryNotFound
Definition:
EDMException.h:34
edm::errors::InsertFailure
Definition:
EDMException.h:35
trackingPlots.other
other
Definition:
trackingPlots.py:1464
edm::Exception::~Exception
~Exception() noexcept override
Definition:
EDMException.cc:73
edm::errors::ExceededResourceRSS
Definition:
EDMException.h:63
edm::errors::codeMap
static const std::map< ErrorCodes, std::string > codeMap
Definition:
EDMException.cc:9
edm::errors::EventProcessorFailure
Definition:
EDMException.h:46
edm::errors::FileNameInconsistentWithGUID
Definition:
EDMException.h:68
edm::Exception::rethrow
void rethrow() override
Definition:
EDMException.cc:102
edm::errors::ExceededResourceTime
Definition:
EDMException.h:64
edm::errors::ScheduleExecutionFailure
Definition:
EDMException.h:45
edm::errors::StdException
Definition:
EDMException.h:28
edm::errors::FallbackFileOpenError
Definition:
EDMException.h:59
edm::Exception::returnCode_
int returnCode_() const override
Definition:
EDMException.cc:81
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::errors::ExceededResourceVSize
Definition:
EDMException.h:62
edm::Exception::swap
void swap(Exception &other)
Definition:
EDMException.h:93
std
Definition:
JetResolutionObject.h:76
edm::Exception::codeToString
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition:
EDMException.cc:52
edm::errors::ConfigFileReadError
Definition:
EDMException.h:25
edm::errors::NoProductSpecified
Definition:
EDMException.h:41
edm::errors::CommandLineProcessing
Definition:
EDMException.h:23
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition:
EDMException.cc:83
edm::errors::OtherCMS
Definition:
EDMException.h:27
edm::errors::BadAlloc
Definition:
EDMException.h:30
edm::errors::FormatIncompatibility
Definition:
EDMException.h:58
cms::Exception
Definition:
Exception.h:70
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
edm::errors::FileReadError
Definition:
EDMException.h:50
edm::errors::Configuration
Definition:
EDMException.h:36
edm::errors::UnimplementedFeature
Definition:
EDMException.h:38
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
Generated for CMSSW Reference Manual by
1.8.16