CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Utilities/interface/EDMException.h

Go to the documentation of this file.
00001 #ifndef FWCore_Utilities_EDMException_h
00002 #define FWCore_Utilities_EDMException_h
00003 
00021 #include "FWCore/Utilities/interface/Exception.h"
00022 #include <map>
00023 #include <string>
00024 
00025 #define EDM_MAP_ENTRY(map, ns, name) map[ns::name]=#name
00026 #define EDM_MAP_ENTRY_NONS(map, name) map[name]=#name
00027 
00028 namespace edm {
00029   namespace errors {
00030 
00031     // If you add a new entry to the set of values, make sure to
00032     // update the translation map in EDMException.cc, the actions
00033     // table in FWCore/Framework/src/Actions.cc, and the configuration
00034     // fragment FWCore/Framework/test/cmsExceptionsFatalOption.cff.
00035 
00036     enum ErrorCodes {
00037        OtherCMS = 8001,
00038        StdException = 8002,
00039        Unknown = 8003,
00040        BadAlloc = 8004,
00041        BadExceptionType = 8005,
00042 
00043        ProductNotFound = 8006,
00044        DictionaryNotFound = 8007,
00045        InsertFailure = 8008,
00046        Configuration = 8009,
00047        LogicError = 8010,
00048        UnimplementedFeature = 8011,
00049        InvalidReference = 8012,
00050        NullPointerError = 8013,
00051        NoProductSpecified = 8014,
00052        EventTimeout = 8015,
00053        EventCorruption = 8016,
00054 
00055        ScheduleExecutionFailure = 8017,
00056        EventProcessorFailure = 8018,
00057 
00058        FileInPathError = 8019,
00059        FileOpenError = 8020,
00060        FileReadError = 8021,
00061        FatalRootError = 8022,
00062        MismatchedInputFiles = 8023,
00063 
00064        ProductDoesNotSupportViews = 8024,
00065        ProductDoesNotSupportPtr = 8025,
00066 
00067        NotFound = 8026
00068     };
00069 
00070   }
00071 
00072   class Exception : public cms::Exception {
00073   public:
00074     typedef errors::ErrorCodes Code;
00075 
00076     explicit Exception(Code category);
00077 
00078     Exception(Code category, std::string const& message);
00079 
00080     Exception(Code category, std::string const& message, cms::Exception const& another);
00081 
00082     Exception(Exception const& other);
00083 
00084     virtual ~Exception() throw();
00085 
00086     Code categoryCode() const { return category_; }
00087 
00088     int returnCode() const { return static_cast<int>(category_); }
00089 
00090     static std::string codeToString(Code);
00091 
00092     typedef std::map<Code, std::string> CodeMap; 
00093 
00094     static void throwThis(Code category,
00095                           char const* message0 = "",
00096                           char const* message1 = "",
00097                           char const* message2 = "",
00098                           char const* message3 = "",
00099                           char const* message4 = "");
00100     static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
00101   private:
00102 
00103     virtual void rethrow();
00104 
00105     Code category_;
00106   };
00107 
00108 }
00109 
00110 #endif