CMS 3D CMS Logo

EDMException.cc
Go to the documentation of this file.
1 
3 
4 #define FILLENTRY(name) \
5  { name, #name }
6 
7 namespace edm {
8  namespace errors {
9  static const std::map<ErrorCodes, std::string> codeMap = {FILLENTRY(CommandLineProcessing),
48  static const std::string kUnknownCode("unknownCode");
49  } // namespace errors
51 
53  auto i(errors::codeMap.find(c));
54  return i != errors::codeMap.end() ? i->second : errors::kUnknownCode;
55  }
56 
57  Exception::Exception(errors::ErrorCodes aCategory) : cms::Exception(codeToString(aCategory)), category_(aCategory) {}
58 
60  : cms::Exception(codeToString(aCategory), message), category_(aCategory) {}
61 
62  Exception::Exception(errors::ErrorCodes aCategory, char const* message)
63  : cms::Exception(codeToString(aCategory), std::string(message)), category_(aCategory) {}
64 
65  Exception::Exception(errors::ErrorCodes aCategory, std::string const& message, cms::Exception const& another)
66  : cms::Exception(codeToString(aCategory), message, another), category_(aCategory) {}
67 
68  Exception::Exception(errors::ErrorCodes aCategory, char const* message, cms::Exception const& another)
69  : cms::Exception(codeToString(aCategory), std::string(message), another), category_(aCategory) {}
70 
71  Exception::Exception(Exception const& other) : cms::Exception(other), category_(other.category_) {}
72 
73  Exception::~Exception() noexcept {}
74 
77  this->swap(temp);
78  return *this;
79  }
80 
81  int Exception::returnCode_() const { return static_cast<int>(category_); }
82 
84  char const* message0,
85  char const* message1,
86  char const* message2,
87  char const* message3,
88  char const* message4) {
89  Exception e(aCategory, std::string(message0));
90  e << message1 << message2 << message3 << message4;
91  throw e;
92  }
93 
94  void Exception::throwThis(errors::ErrorCodes aCategory, char const* message0, int intVal, char const* message1) {
95  Exception e(aCategory, std::string(message0));
96  e << intVal << message1;
97  throw e;
98  }
99 
100  Exception* Exception::clone() const { return new Exception(*this); }
101 
102  void Exception::rethrow() { throw *this; }
103 } // namespace edm
edm::errors::MismatchedInputFiles
Definition: EDMException.h:52
mps_fire.i
i
Definition: mps_fire.py:428
edm::Exception::category_
Code category_
Definition: EDMException.h:115
edm::errors::InvalidReference
Definition: EDMException.h:39
edm::errors::ConfigFileNotFound
Definition: EDMException.h:24
edm::errors::EventTimeout
Definition: EDMException.h:42
edm::errors::LogicError
Definition: EDMException.h:37
edm::errors::ProductDoesNotSupportPtr
Definition: EDMException.h:55
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::errors::EventCorruption
Definition: EDMException.h:43
edm::errors::FileWriteError
Definition: EDMException.h:66
edm::errors::CaughtSignal
Definition: EDMException.h:72
edm::errors::EventGenerationFailure
Definition: EDMException.h:70
edm::Exception::Exception
Exception(Code category)
Definition: EDMException.cc:57
edm::errors::Unknown
Definition: EDMException.h:29
edm::errors::ErrorCodes
ErrorCodes
Definition: EDMException.h:22
edm::Exception::operator=
Exception & operator=(Exception const &other)
Definition: EDMException.cc:75
edm::errors::BadExceptionType
Definition: EDMException.h:31
edm::errors::NoSecondaryFiles
Definition: EDMException.h:60
edm::errors::FileInPathError
Definition: EDMException.h:48
FILLENTRY
#define FILLENTRY(name)
Definition: EDMException.cc:4
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::errors::NotFound
Definition: EDMException.h:57
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::errors::FileOpenError
Definition: EDMException.h:49
edm::Exception
Definition: EDMException.h:77
EDMException.h
edm::errors::ProductNotFound
Definition: EDMException.h:33
edm::errors::NullPointerError
Definition: EDMException.h:40
edm::errors::ProductDoesNotSupportViews
Definition: EDMException.h:54
edm::Exception::clone
Exception * clone() const override
Definition: EDMException.cc:100
errors
Definition: errors.py:1
edm::errors::FatalRootError
Definition: EDMException.h:51
edm::errors::kUnknownCode
static const std::string kUnknownCode("unknownCode")
edm::errors::DictionaryNotFound
Definition: EDMException.h:34
edm::errors::InsertFailure
Definition: EDMException.h:35
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::Exception::~Exception
~Exception() noexcept override
Definition: EDMException.cc:73
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::errors::ExceededResourceRSS
Definition: EDMException.h:63
edm::errors::codeMap
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:9
edm::errors::EventProcessorFailure
Definition: EDMException.h:46
edm::errors::FileNameInconsistentWithGUID
Definition: EDMException.h:68
edm::Exception::rethrow
void rethrow() override
Definition: EDMException.cc:102
edm::errors::ExceededResourceTime
Definition: EDMException.h:64
edm::errors::ScheduleExecutionFailure
Definition: EDMException.h:45
edm::errors::StdException
Definition: EDMException.h:28
edm::errors::FallbackFileOpenError
Definition: EDMException.h:59
edm::Exception::returnCode_
int returnCode_() const override
Definition: EDMException.cc:81
edm::errors::ExceededResourceVSize
Definition: EDMException.h:62
edm::Exception::swap
void swap(Exception &other)
Definition: EDMException.h:93
std
Definition: JetResolutionObject.h:76
edm::Exception::codeToString
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
edm::errors::ConfigFileReadError
Definition: EDMException.h:25
edm::errors::NoProductSpecified
Definition: EDMException.h:41
edm::errors::CommandLineProcessing
Definition: EDMException.h:23
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::errors::OtherCMS
Definition: EDMException.h:27
edm::errors::BadAlloc
Definition: EDMException.h:30
edm::errors::FormatIncompatibility
Definition: EDMException.h:58
cms::Exception
Definition: Exception.h:70
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::errors::FileReadError
Definition: EDMException.h:50
edm::errors::Configuration
Definition: EDMException.h:36
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37