CMS 3D CMS Logo

EDMException.cc
Go to the documentation of this file.
1 
3 
4 #define FILLENTRY( name ) {name, #name }
5 
6 namespace edm {
7  namespace errors {
8  static const std::map<ErrorCodes, std::string> codeMap =
9  {
47  };
48  static const std::string kUnknownCode("unknownCode");
49  }
51 
53  auto i(errors::codeMap.find(c));
54  return i!=errors::codeMap.end() ? i->second : errors::kUnknownCode;
55  }
56 
58  cms::Exception(codeToString(aCategory)),
59  category_(aCategory) {
60  }
61 
63  cms::Exception(codeToString(aCategory),message),
64  category_(aCategory) {
65  }
66 
68  cms::Exception(codeToString(aCategory), std::string(message)),
69  category_(aCategory) {
70  }
71 
73  cms::Exception(codeToString(aCategory),message,another),
74  category_(aCategory) {
75  }
76 
77  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another):
78  cms::Exception(codeToString(aCategory), std::string(message), another),
79  category_(aCategory) {
80  }
81 
83  cms::Exception(other),
84  category_(other.category_) {
85  }
86 
88  }
89 
90  Exception&
92  Exception temp(other);
93  this->swap(temp);
94  return *this;
95  }
96 
97  int
99  return static_cast<int>(category_);
100  }
101 
102  void
104  char const* message0,
105  char const* message1,
106  char const* message2,
107  char const* message3,
108  char const* message4) {
109  Exception e(aCategory, std::string(message0));
110  e << message1 << message2 << message3 << message4;
111  throw e;
112  }
113 
114  void
115  Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
116  Exception e(aCategory, std::string(message0));
117  e << intVal << message1;
118  throw e;
119  }
120 
122  return new Exception(*this);
123  }
124 
125  void
127  throw *this;
128  }
129 }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
void rethrow() override
int returnCode_() const override
Definition: EDMException.cc:98
#define noexcept
std::string message() const
Definition: Exception.cc:187
#define FILLENTRY(name)
Definition: EDMException.cc:4
static const std::string kUnknownCode("unknownCode")
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void swap(Exception &other)
Definition: EDMException.h:91
Exception * clone() const override
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:8
~Exception() override
Definition: EDMException.cc:87
Namespace of DDCMS conversion namespace.
Exception(Code category)
Definition: EDMException.cc:57
HLT enums.
Definition: errors.py:1
Exception & operator=(Exception const &other)
Definition: EDMException.cc:91