CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDMException.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_EDMException_h
2 #define FWCore_Utilities_EDMException_h
3 
12 #include <map>
13 #include <string>
14 
15 #define EDM_MAP_ENTRY(map, ns, name) map[ns::name]=#name
16 #define EDM_MAP_ENTRY_NONS(map, name) map[name]=#name
17 
18 namespace edm {
19  namespace errors {
20 
21  // If you add a new entry to the set of values, make sure to
22  // update the translation map in EDMException.cc, the actions
23  // table in FWCore/Framework/src/Actions.cc, and the configuration
24  // fragment FWCore/Framework/python/test/cmsExceptionsFatalOption_cff.py.
25 
26  enum ErrorCodes {
30 
31  OtherCMS = 8001,
32  StdException = 8002,
33  Unknown = 8003,
34  BadAlloc = 8004,
36 
39  InsertFailure = 8008,
40  Configuration = 8009,
41  LogicError = 8010,
46  EventTimeout = 8015,
48 
51 
53  FileOpenError = 8020,
54  FileReadError = 8021,
57 
60 
61  NotFound = 8026,
64 
68 
70 
71  CaughtSignal = 9000
72  };
73 
74  }
75 
77  public:
79 
80  explicit Exception(Code category);
81 
83  Exception(Code category, char const* message);
84 
85  Exception(Code category, std::string const& message, cms::Exception const& another);
86  Exception(Code category, char const* message, cms::Exception const& another);
87 
88  Exception(Exception const& other);
89 
90  virtual ~Exception() throw();
91 
92  void swap(Exception& other) {
93  std::swap(category_, other.category_);
94  }
95 
96  Exception& operator=(Exception const& other);
97 
98  Code categoryCode() const { return category_; }
99 
100  static std::string codeToString(Code);
101 
102  typedef std::map<Code, std::string> CodeMap;
103 
104  static void throwThis(Code category,
105  char const* message0 = "",
106  char const* message1 = "",
107  char const* message2 = "",
108  char const* message3 = "",
109  char const* message4 = "");
110  static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
111 
112  virtual Exception* clone() const;
113 
114  private:
115 
116  virtual void rethrow();
117  virtual int returnCode_() const;
118 
120  };
121 }
122 
123 #endif
Code categoryCode() const
Definition: EDMException.h:98
errors::ErrorCodes Code
Definition: EDMException.h:78
#define dso_export
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
std::map< Code, std::string > CodeMap
Definition: EDMException.h:102