LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Exception.h
Go to the documentation of this file.
1 #ifndef canvas_Utilities_Exception_h
2 #define canvas_Utilities_Exception_h
3 
4 // ======================================================================
5 //
6 // Exception: art-specific customizations for cetlib/coded_exception
7 //
8 // Note that errors::ErrorCodes is tightly coupled to detail::translate()
9 // such that any change to one will necessitate a corresponding change to
10 // the other. The actions table in Framework/Core/Actions may also need
11 // adjustment.
12 //
13 // ======================================================================
14 
15 #include "cetlib_except/coded_exception.h"
16 #include <string>
17 
18 // ----------------------------------------------------------------------
19 
20 namespace art {
21  namespace errors {
22 
23  enum ErrorCodes {
24  OtherArt = 1,
33  LogicError, // = 10
43  FileOpenError, // = 20
53  ServiceNotFound, // = 30
57  };
58 
59  } // errors
60 
61  namespace ExceptionDetail {
62  std::string translate(errors::ErrorCodes);
63  }
64 
65  using Exception =
66  cet::coded_exception<errors::ErrorCodes, ExceptionDetail::translate>;
67 
68 } // art
69 
70 // ======================================================================
71 
72 #endif /* canvas_Utilities_Exception_h */
73 
74 // Local Variables:
75 // mode: c++
76 // End:
std::string translate(errors::ErrorCodes)
Definition: Exception.cc:18
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Definition: MVAAlg.h:12