LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Exception.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Exception: art-specific customizations for cetlib/coded_exception
4 //
5 // Note that errors::ErrorCodes is tightly coupled to detail::translate()
6 // such that any change to one will necessitate a corresponding change to
7 // the other. The actions table in Framework/Core/Actions may also need
8 // adjustment.
9 //
10 // ======================================================================
11 
13 
14 using namespace art;
15 
16 // Map an art::errors::ErrorCodes into the appropriate string.
17 std::string
19 {
20  using namespace errors;
21 
22  switch (code) {
23  // Let the compiler tell us we missed one.
24  // default : return "Unknown code";
25 
26  case OtherArt:
27  return "OtherArt";
28  case StdException:
29  return "StdException";
30  case Unknown:
31  return "Unknown";
32  case BadAlloc:
33  return "BadAlloc";
34  case BadExceptionType:
35  return "BadExceptionType";
36  case ProductNotFound:
37  return "ProductNotFound";
38  case DictionaryNotFound:
39  return "DictionaryNotFound";
40  case ProductPutFailure:
41  return "ProductPutFailure";
42  case Configuration:
43  return "Configuration";
44  case LogicError:
45  return "LogicError";
47  return "UnimplementedFeature";
48  case InvalidReference:
49  return "InvalidReference";
50  case TypeConversion:
51  return "TypeConversion";
52  case NullPointerError:
53  return "NullPointerError";
54  case EventTimeout:
55  return "EventTimeout";
56  case DataCorruption:
57  return "DataCorruption";
59  return "ScheduleExecutionFailure";
61  return "EventProcessorFailure";
62  case EndJobFailure:
63  return "EndJobFailure";
64  case FileOpenError:
65  return "FileOpenError";
66  case FileReadError:
67  return "FileReadError";
68  case FatalRootError:
69  return "FatalRootError";
71  return "MismatchedInputFiles";
73  return "CatalogServiceError";
75  return "ProductDoesNotSupportViews";
77  return "ProductDoesNotSupportPtr";
78  case SQLExecutionError:
79  return "SQLExecutionError";
80  case InvalidNumber:
81  return "InvalidNumber";
82  case NotFound:
83  return "NotFound";
84  case ServiceNotFound:
85  return "ServiceNotFound";
87  return "ProductCannotBeAggregated";
89  return "ProductRegistrationFailure";
90  case EventRangeOverlap:
91  return "EventRangeOverlap";
92  }
94  << "Internal error: missing string translation for error " << code
95  << " which was not caught at compile time!\n";
96 }
97 
98 // ======================================================================
std::string translate(errors::ErrorCodes)
Definition: Exception.cc:18
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
HLT enums.