CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  {
46  };
47  static const std::string kUnknownCode("unknownCode");
48  }
50 
52  auto i(errors::codeMap.find(c));
53  return i!=errors::codeMap.end() ? i->second : errors::kUnknownCode;
54  }
55 
57  cms::Exception(codeToString(aCategory)),
58  category_(aCategory) {
59  }
60 
62  cms::Exception(codeToString(aCategory),message),
63  category_(aCategory) {
64  }
65 
67  cms::Exception(codeToString(aCategory), std::string(message)),
68  category_(aCategory) {
69  }
70 
72  cms::Exception(codeToString(aCategory),message,another),
73  category_(aCategory) {
74  }
75 
76  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another):
77  cms::Exception(codeToString(aCategory), std::string(message), another),
78  category_(aCategory) {
79  }
80 
82  cms::Exception(other),
83  category_(other.category_) {
84  }
85 
87  }
88 
89  Exception&
91  Exception temp(other);
92  this->swap(temp);
93  return *this;
94  }
95 
96  int
98  return static_cast<int>(category_);
99  }
100 
101  void
103  char const* message0,
104  char const* message1,
105  char const* message2,
106  char const* message3,
107  char const* message4) {
108  Exception e(aCategory, std::string(message0));
109  e << message1 << message2 << message3 << message4;
110  throw e;
111  }
112 
113  void
114  Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
115  Exception e(aCategory, std::string(message0));
116  e << intVal << message1;
117  throw e;
118  }
119 
121  return new Exception(*this);
122  }
123 
124  void
126  throw *this;
127  }
128 }
int i
Definition: DBlmapReader.cc:9
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:51
#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:7
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:88
virtual Exception * clone() const
virtual int returnCode_() const
Definition: EDMException.cc:97
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:8
Exception(Code category)
Definition: EDMException.cc:56
Exception & operator=(Exception const &other)
Definition: EDMException.cc:90
virtual void rethrow()
virtual ~Exception()
Definition: EDMException.cc:86