Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:12:45

0001 #ifndef FWCore_Utilities_EDMException_h
0002 #define FWCore_Utilities_EDMException_h
0003 
0004 /**
0005  This is the basic exception that is thrown by the framework code.
0006  It exists primarily to distinguish framework thrown exception types
0007  from developer thrown exception types. As such there is very little
0008  interface other than constructors specific to this derived type.
0009 **/
0010 
0011 #include "FWCore/Utilities/interface/Exception.h"
0012 #include <map>
0013 #include <string>
0014 
0015 namespace edm {
0016   namespace errors {
0017 
0018     // If you add a new entry to the set of values, make sure to
0019     // update the translation map in EDMException.cc, and the configuration
0020     // fragment FWCore/Framework/python/test/cmsExceptionsFatalOption_cff.py.
0021 
0022     enum ErrorCodes {
0023       CommandLineProcessing = 7000,
0024       ConfigFileNotFound = 7001,
0025       ConfigFileReadError = 7002,
0026 
0027       OtherCMS = 8001,
0028       StdException = 8002,
0029       Unknown = 8003,
0030       BadAlloc = 8004,
0031       BadExceptionType = 8005,
0032 
0033       ProductNotFound = 8006,
0034       DictionaryNotFound = 8007,
0035       InsertFailure = 8008,
0036       Configuration = 8009,
0037       LogicError = 8010,
0038       UnimplementedFeature = 8011,
0039       InvalidReference = 8012,
0040       NullPointerError = 8013,
0041       NoProductSpecified = 8014,
0042       EventTimeout = 8015,
0043       EventCorruption = 8016,
0044 
0045       ScheduleExecutionFailure = 8017,
0046       EventProcessorFailure = 8018,
0047 
0048       FileInPathError = 8019,
0049       FileOpenError = 8020,
0050       FileReadError = 8021,
0051       FatalRootError = 8022,
0052       MismatchedInputFiles = 8023,
0053 
0054       ProductDoesNotSupportViews = 8024,
0055       ProductDoesNotSupportPtr = 8025,
0056 
0057       NotFound = 8026,
0058       FormatIncompatibility = 8027,
0059       FallbackFileOpenError = 8028,
0060       NoSecondaryFiles = 8029,
0061 
0062       ExceededResourceVSize = 8030,
0063       ExceededResourceRSS = 8031,
0064       ExceededResourceTime = 8032,
0065 
0066       FileWriteError = 8033,
0067 
0068       FileNameInconsistentWithGUID = 8034,
0069 
0070       UnavailableAccelerator = 8035,
0071 
0072       EventGenerationFailure = 8501,
0073 
0074       CaughtSignal = 9000
0075     };
0076 
0077   }  // namespace errors
0078 
0079   class dso_export Exception : public cms::Exception {
0080   public:
0081     typedef errors::ErrorCodes Code;
0082 
0083     explicit Exception(Code category);
0084 
0085     Exception(Code category, std::string const& message);
0086     Exception(Code category, char const* message);
0087 
0088     Exception(Code category, std::string const& message, cms::Exception const& another);
0089     Exception(Code category, char const* message, cms::Exception const& another);
0090 
0091     Exception(Exception const& other);
0092 
0093     ~Exception() noexcept override;
0094 
0095     void swap(Exception& other) { std::swap(category_, other.category_); }
0096 
0097     Exception& operator=(Exception const& other);
0098 
0099     Code categoryCode() const { return category_; }
0100 
0101     static const std::string& codeToString(Code);
0102 
0103     static void throwThis(Code category,
0104                           char const* message0 = "",
0105                           char const* message1 = "",
0106                           char const* message2 = "",
0107                           char const* message3 = "",
0108                           char const* message4 = "");
0109     static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
0110 
0111     Exception* clone() const override;
0112 
0113   private:
0114     void rethrow() override;
0115     int returnCode_() const override;
0116 
0117     Code category_;
0118   };
0119 }  // namespace edm
0120 
0121 #endif