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, and the configuration
20  // fragment FWCore/Framework/python/test/cmsExceptionsFatalOption_cff.py.
21 
22  enum ErrorCodes {
26 
27  OtherCMS = 8001,
28  StdException = 8002,
29  Unknown = 8003,
30  BadAlloc = 8004,
32 
35  InsertFailure = 8008,
36  Configuration = 8009,
37  LogicError = 8010,
42  EventTimeout = 8015,
44 
47 
49  FileOpenError = 8020,
50  FileReadError = 8021,
53 
56 
57  NotFound = 8026,
61 
65 
67 
69 
72 
74 
76 
77  CaughtSignal = 9000
78  };
79 
80  } // namespace errors
81 
83  public:
85 
86  explicit Exception(Code category);
87 
88  Exception(Code category, std::string const& message);
89  Exception(Code category, char const* message);
90 
91  Exception(Code category, std::string const& message, cms::Exception const& another);
92  Exception(Code category, char const* message, cms::Exception const& another);
93 
94  Exception(Exception const& other);
95 
96  ~Exception() noexcept override;
97 
98  void swap(Exception& other) { std::swap(category_, other.category_); }
99 
101 
102  Code categoryCode() const { return category_; }
103 
104  static const std::string& codeToString(Code);
105 
106  [[noreturn]] static void throwThis(Code category,
107  char const* message0 = "",
108  char const* message1 = "",
109  char const* message2 = "",
110  char const* message3 = "",
111  char const* message4 = "");
112  [[noreturn]] static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
113 
114  Exception* clone() const override;
115 
116  private:
117  [[noreturn]] void rethrow() override;
118  int returnCode_() const override;
119 
121  };
122 } // namespace edm
123 
124 #endif
Basic3DVector & operator=(const Basic3DVector &)=default
Assignment operator.
errors::ErrorCodes Code
Definition: EDMException.h:84
#define dso_export
Definition: Visibility.h:11
Code categoryCode() const
Definition: EDMException.h:102
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
HLT enums.
Definition: errors.py:1