CMS 3D CMS Logo

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 namespace edm {
16  namespace errors {
17 
18  // If you add a new entry to the set of values, make sure to
19  // update the translation map in EDMException.cc, the actions
20  // table in FWCore/Framework/src/Actions.cc, and the configuration
21  // fragment FWCore/Framework/python/test/cmsExceptionsFatalOption_cff.py.
22 
23  enum ErrorCodes {
27 
28  OtherCMS = 8001,
29  StdException = 8002,
30  Unknown = 8003,
31  BadAlloc = 8004,
33 
36  InsertFailure = 8008,
37  Configuration = 8009,
38  LogicError = 8010,
43  EventTimeout = 8015,
45 
48 
50  FileOpenError = 8020,
51  FileReadError = 8021,
54 
57 
58  NotFound = 8026,
62 
66 
68 
70 
71  CaughtSignal = 9000
72  };
73 
74  } // namespace errors
75 
77  public:
79 
80  explicit Exception(Code category);
81 
82  Exception(Code category, std::string const& message);
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  ~Exception() noexcept override;
91 
92  void swap(Exception& other) { std::swap(category_, other.category_); }
93 
94  Exception& operator=(Exception const& other);
95 
96  Code categoryCode() const { return category_; }
97 
98  static const std::string& codeToString(Code);
99 
100  static void throwThis(Code category,
101  char const* message0 = "",
102  char const* message1 = "",
103  char const* message2 = "",
104  char const* message3 = "",
105  char const* message4 = "");
106  static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
107 
108  Exception* clone() const override;
109 
110  private:
111  void rethrow() override;
112  int returnCode_() const override;
113 
114  Code category_;
115  };
116 } // namespace edm
117 
118 #endif
Code categoryCode() const
Definition: EDMException.h:96
errors::ErrorCodes Code
Definition: EDMException.h:78
#define dso_export
Definition: Visibility.h:11
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:116
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
#define noexcept
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
HLT enums.
Definition: errors.py:1