Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:12

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       ExternalFailure = 8036,
0072 
0073       EventGenerationFailure = 8501,
0074 
0075       UnexpectedJobTermination = 8901,
0076 
0077       CaughtSignal = 9000
0078     };
0079 
0080   }  // namespace errors
0081 
0082   class dso_export Exception : public cms::Exception {
0083   public:
0084     typedef errors::ErrorCodes Code;
0085 
0086     explicit Exception(Code category);
0087 
0088     Exception(Code category, std::string const& message);
0089     Exception(Code category, char const* message);
0090 
0091     Exception(Code category, std::string const& message, cms::Exception const& another);
0092     Exception(Code category, char const* message, cms::Exception const& another);
0093 
0094     Exception(Exception const& other);
0095 
0096     ~Exception() noexcept override;
0097 
0098     void swap(Exception& other) { std::swap(category_, other.category_); }
0099 
0100     Exception& operator=(Exception const& other);
0101 
0102     Code categoryCode() const { return category_; }
0103 
0104     static const std::string& codeToString(Code);
0105 
0106     static void throwThis(Code category,
0107                           char const* message0 = "",
0108                           char const* message1 = "",
0109                           char const* message2 = "",
0110                           char const* message3 = "",
0111                           char const* message4 = "");
0112     static void throwThis(Code category, char const* message0, int intVal, char const* message2 = "");
0113 
0114     Exception* clone() const override;
0115 
0116   private:
0117     void rethrow() override;
0118     int returnCode_() const override;
0119 
0120     Code category_;
0121   };
0122 }  // namespace edm
0123 
0124 #endif