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