CMS 3D CMS Logo

EDMException.cc
Go to the documentation of this file.
1 
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),
48  static const std::string kUnknownCode("unknownCode");
49  } // namespace errors
51 
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 
60  : cms::Exception(codeToString(aCategory), message), category_(aCategory) {}
61 
63  : cms::Exception(codeToString(aCategory), std::string(message)), category_(aCategory) {}
64 
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 
72 
74 
76  Exception temp(other);
77  this->swap(temp);
78  return *this;
79  }
80 
81  int Exception::returnCode_() const { return static_cast<int>(category_); }
82 
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
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
void rethrow() override
int returnCode_() const override
Definition: EDMException.cc:81
std::string message() const
Definition: Exception.cc:145
#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="")
Definition: EDMException.cc:83
void swap(Exception &other)
Definition: EDMException.h:93
Exception * clone() const override
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:9
~Exception() override
Definition: EDMException.cc:73
Namespace of DDCMS conversion namespace.
#define noexcept
Exception(Code category)
Definition: EDMException.cc:57
HLT enums.
Definition: errors.py:1
Exception & operator=(Exception const &other)
Definition: EDMException.cc:75