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  {
48  };
49  static const std::string kUnknownCode("unknownCode");
50  }
52 
54  auto i(errors::codeMap.find(c));
55  return i!=errors::codeMap.end() ? i->second : errors::kUnknownCode;
56  }
57 
59  cms::Exception(codeToString(aCategory)),
60  category_(aCategory) {
61  }
62 
64  cms::Exception(codeToString(aCategory),message),
65  category_(aCategory) {
66  }
67 
69  cms::Exception(codeToString(aCategory), std::string(message)),
70  category_(aCategory) {
71  }
72 
74  cms::Exception(codeToString(aCategory),message,another),
75  category_(aCategory) {
76  }
77 
78  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another):
79  cms::Exception(codeToString(aCategory), std::string(message), another),
80  category_(aCategory) {
81  }
82 
84  cms::Exception(other),
85  category_(other.category_) {
86  }
87 
89  }
90 
91  Exception&
93  Exception temp(other);
94  this->swap(temp);
95  return *this;
96  }
97 
98  int
100  return static_cast<int>(category_);
101  }
102 
103  void
105  char const* message0,
106  char const* message1,
107  char const* message2,
108  char const* message3,
109  char const* message4) {
110  Exception e(aCategory, std::string(message0));
111  e << message1 << message2 << message3 << message4;
112  throw e;
113  }
114 
115  void
116  Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
117  Exception e(aCategory, std::string(message0));
118  e << intVal << message1;
119  throw e;
120  }
121 
123  return new Exception(*this);
124  }
125 
126  void
128  throw *this;
129  }
130 }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:53
void rethrow() override
int returnCode_() const override
Definition: EDMException.cc:99
#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:92
Exception * clone() const override
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:8
~Exception() override
Definition: EDMException.cc:88
Namespace of DDCMS conversion namespace.
Exception(Code category)
Definition: EDMException.cc:58
HLT enums.
Definition: errors.py:1
Exception & operator=(Exception const &other)
Definition: EDMException.cc:92