CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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 
00011 #include "FWCore/Utilities/interface/Exception.h"
00012 #include <map>
00013 #include <string>
00014 
00015 #define EDM_MAP_ENTRY(map, ns, name) map[ns::name]=#name
00016 #define EDM_MAP_ENTRY_NONS(map, name) map[name]=#name
00017 
00018 namespace edm {
00019   namespace errors {
00020 
00021     // If you add a new entry to the set of values, make sure to
00022     // update the translation map in EDMException.cc, the actions
00023     // table in FWCore/Framework/src/Actions.cc, and the configuration
00024     // fragment FWCore/Framework/python/test/cmsExceptionsFatalOption_cff.py.
00025 
00026     enum ErrorCodes {
00027        CommandLineProcessing = 7000,
00028        ConfigFileNotFound = 7001,
00029        ConfigFileReadError = 7002,
00030 
00031        OtherCMS = 8001,
00032        StdException = 8002,
00033        Unknown = 8003,
00034        BadAlloc = 8004,
00035        BadExceptionType = 8005,
00036 
00037        ProductNotFound = 8006,
00038        DictionaryNotFound = 8007,
00039        InsertFailure = 8008,
00040        Configuration = 8009,
00041        LogicError = 8010,
00042        UnimplementedFeature = 8011,
00043        InvalidReference = 8012,
00044        NullPointerError = 8013,
00045        NoProductSpecified = 8014,
00046        EventTimeout = 8015,
00047        EventCorruption = 8016,
00048 
00049        ScheduleExecutionFailure = 8017,
00050        EventProcessorFailure = 8018,
00051 
00052        FileInPathError = 8019,
00053        FileOpenError = 8020,
00054        FileReadError = 8021,
00055        FatalRootError = 8022,
00056        MismatchedInputFiles = 8023,
00057 
00058        ProductDoesNotSupportViews = 8024,
00059        ProductDoesNotSupportPtr = 8025,
00060 
00061        NotFound = 8026,
00062        FormatIncompatibility = 8027,
00063        FallbackFileOpenError = 8028,
00064       
00065        ExceededResourceVSize = 8030,
00066        ExceededResourceRSS = 8031,
00067        ExceededResourceTime = 8032,
00068       
00069        CaughtSignal = 9000
00070     };
00071 
00072   }
00073 
00074   class dso_export Exception : public cms::Exception {
00075   public:
00076     typedef errors::ErrorCodes Code;
00077 
00078     explicit Exception(Code category);
00079 
00080     Exception(Code category, std::string const& message);
00081     Exception(Code category, char const*        message);
00082 
00083     Exception(Code category, std::string const& message, cms::Exception const& another);
00084     Exception(Code category, char const*        message, cms::Exception const& another);
00085 
00086     Exception(Exception const& other);
00087 
00088     virtual ~Exception() throw();
00089 
00090     void swap(Exception& other) {
00091       std::swap(category_, other.category_);
00092     }
00093 
00094     Exception& operator=(Exception const& other);
00095 
00096     Code categoryCode() const { return category_; }
00097 
00098     static std::string codeToString(Code);
00099 
00100     typedef std::map<Code, std::string> CodeMap; 
00101 
00102     static void throwThis(Code category,
00103                           char const* message0 = "",
00104                           char const* message1 = "",
00105                           char const* message2 = "",
00106                           char const* message3 = "",
00107                           char const* message4 = "");
00108     static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
00109 
00110     virtual Exception* clone() const;
00111 
00112   private:
00113 
00114     virtual void rethrow();
00115     virtual int returnCode_() const;
00116 
00117     Code category_;
00118   };
00119 }
00120 
00121 #endif