CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 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 
71 
72  CaughtSignal = 9000
73  };
74 
75  } // namespace errors
76 
78  public:
80 
81  explicit Exception(Code category);
82 
83  Exception(Code category, std::string const& message);
84  Exception(Code category, char const* message);
85 
86  Exception(Code category, std::string const& message, cms::Exception const& another);
87  Exception(Code category, char const* message, cms::Exception const& another);
88 
89  Exception(Exception const& other);
90 
91  ~Exception() noexcept override;
92 
93  void swap(Exception& other) { std::swap(category_, other.category_); }
94 
95  Exception& operator=(Exception const& other);
96 
97  Code categoryCode() const { return category_; }
98 
99  static const std::string& codeToString(Code);
100 
101  static void throwThis(Code category,
102  char const* message0 = "",
103  char const* message1 = "",
104  char const* message2 = "",
105  char const* message3 = "",
106  char const* message4 = "");
107  static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
108 
109  Exception* clone() const override;
110 
111  private:
112  void rethrow() override;
113  int returnCode_() const override;
114 
116  };
117 } // namespace edm
118 
119 #endif
Code categoryCode() const
Definition: EDMException.h:97
errors::ErrorCodes Code
Definition: EDMException.h:79
static const char category[]
#define dso_export
Definition: Visibility.h:11
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135