CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::Exception Class Reference

#include <EDMException.h>

Inheritance diagram for edm::Exception:
cms::Exception XrdAdaptor::XrootdException

Public Types

typedef errors::ErrorCodes Code
 

Public Member Functions

Code categoryCode () const
 
Exceptionclone () const override
 
 Exception (Code category)
 
 Exception (Code category, std::string const &message)
 
 Exception (Code category, char const *message)
 
 Exception (Code category, std::string const &message, cms::Exception const &another)
 
 Exception (Code category, char const *message, cms::Exception const &another)
 
 Exception (Exception const &other)
 
Exceptionoperator= (Exception const &other)
 
void swap (Exception &other)
 
 ~Exception () override
 
- Public Member Functions inherited from cms::Exception
void addAdditionalInfo (std::string const &info)
 
void addAdditionalInfo (char const *info)
 
void addContext (std::string const &context)
 
void addContext (char const *context)
 
std::list< std::string > const & additionalInfo () const
 
bool alreadyPrinted () const
 
void append (Exception const &another)
 
void append (std::string const &more_information)
 
void append (char const *more_information)
 
std::string const & category () const
 
void clearAdditionalInfo ()
 
void clearContext ()
 
void clearMessage ()
 
std::list< std::string > const & context () const
 
 Exception (std::string const &aCategory)
 
 Exception (char const *aCategory)
 
 Exception (std::string const &aCategory, std::string const &message)
 
 Exception (char const *aCategory, std::string const &message)
 
 Exception (std::string const &aCategory, char const *message)
 
 Exception (char const *aCategory, char const *message)
 
 Exception (std::string const &aCategory, std::string const &message, Exception const &another)
 
 Exception (Exception const &other)
 
virtual std::string explainSelf () const
 
std::list< std::string > history () const
 
std::string message () const
 
Exceptionoperator= (Exception const &other)
 
void raise ()
 
int returnCode () const
 
void setAdditionalInfo (std::list< std::string > const &info)
 
void setAlreadyPrinted (bool value)
 
void setContext (std::list< std::string > const &context)
 
void swap (Exception &other)
 
char const * what () const override
 
 ~Exception () override
 

Static Public Member Functions

static const std::string & codeToString (Code)
 -----------— implementation details ---------------— More...
 
static void throwThis (Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
 
static void throwThis (Code category, char const *message0, int intVal, char const *message2="")
 

Private Member Functions

void rethrow () override
 
int returnCode_ () const override
 

Private Attributes

Code category_
 

Detailed Description

Definition at line 75 of file EDMException.h.

Member Typedef Documentation

Definition at line 77 of file EDMException.h.

Constructor & Destructor Documentation

Exception::Exception ( Code  category)
explicit

Definition at line 57 of file EDMException.cc.

Referenced by clone().

57  :
58  cms::Exception(codeToString(aCategory)),
59  category_(aCategory) {
60  }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
Exception::Exception ( Code  category,
std::string const &  message 
)

Definition at line 62 of file EDMException.cc.

62  :
64  category_(aCategory) {
65  }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
std::string message() const
Definition: Exception.cc:187
Exception::Exception ( Code  category,
char const *  message 
)

Definition at line 67 of file EDMException.cc.

67  :
69  category_(aCategory) {
70  }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
std::string message() const
Definition: Exception.cc:187
Exception::Exception ( Code  category,
std::string const &  message,
cms::Exception const &  another 
)

Definition at line 72 of file EDMException.cc.

72  :
73  cms::Exception(codeToString(aCategory),message,another),
74  category_(aCategory) {
75  }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
std::string message() const
Definition: Exception.cc:187
Exception::Exception ( Code  category,
char const *  message,
cms::Exception const &  another 
)

Definition at line 77 of file EDMException.cc.

77  :
78  cms::Exception(codeToString(aCategory), std::string(message), another),
79  category_(aCategory) {
80  }
static const std::string & codeToString(Code)
-----------— implementation details ---------------—
Definition: EDMException.cc:52
std::string message() const
Definition: Exception.cc:187
Exception::Exception ( Exception const &  other)

Definition at line 82 of file EDMException.cc.

82  :
84  category_(other.category_) {
85  }
Exception::~Exception ( )
override

Definition at line 87 of file EDMException.cc.

87  {
88  }

Member Function Documentation

Code edm::Exception::categoryCode ( ) const
inline
Exception * Exception::clone ( void  ) const
overridevirtual

Reimplemented from cms::Exception.

Definition at line 121 of file EDMException.cc.

References Exception().

121  {
122  return new Exception(*this);
123  }
Exception(Code category)
Definition: EDMException.cc:57
const std::string & Exception::codeToString ( Code  c)
static

-----------— implementation details ---------------—

Definition at line 52 of file EDMException.cc.

References edm::errors::codeMap, spr::find(), mps_fire::i, and edm::errors::kUnknownCode().

Referenced by edm::Path::handleWorkerFailure().

52  {
53  auto i(errors::codeMap.find(c));
54  return i!=errors::codeMap.end() ? i->second : errors::kUnknownCode;
55  }
static const std::string kUnknownCode("unknownCode")
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
static const std::map< ErrorCodes, std::string > codeMap
Definition: EDMException.cc:8
Exception & Exception::operator= ( Exception const &  other)

Definition at line 91 of file EDMException.cc.

References swap(), and groupFilesInBlocks::temp.

91  {
93  this->swap(temp);
94  return *this;
95  }
void swap(Exception &other)
Definition: EDMException.h:91
void Exception::rethrow ( )
overrideprivatevirtual

Reimplemented from cms::Exception.

Definition at line 126 of file EDMException.cc.

126  {
127  throw *this;
128  }
int Exception::returnCode_ ( ) const
overrideprivatevirtual

Reimplemented from cms::Exception.

Definition at line 98 of file EDMException.cc.

References category_.

98  {
99  return static_cast<int>(category_);
100  }
void edm::Exception::swap ( Exception other)
inline

Definition at line 91 of file EDMException.h.

References trackingPlots::other, and std::swap().

Referenced by operator=().

91  {
92  std::swap(category_, other.category_);
93  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void Exception::throwThis ( Code  category,
char const *  message0 = "",
char const *  message1 = "",
char const *  message2 = "",
char const *  message3 = "",
char const *  message4 = "" 
)
static

Definition at line 103 of file EDMException.cc.

References MillePedeFileConverter_cfg::e, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edm::dsrvdetail::_throw_range(), edm::detail::_throw_range(), edm::eventsetup::ComponentFactory< T >::addTo(), edm::RefToBaseVector< T >::at(), edm::OwnArray< T, MAX_SIZE, P >::back(), edm::OwnVector< T, P >::back(), edm::RefToBase< T >::castTo(), edm::helpers::checkRef(), edm::reftobase::RefVectorHolder< REFV >::const_iterator_imp_specific::dc(), edm::reftobase::IndirectVectorHolder< T >::const_iterator_imp_specific::dc(), edm::reftobase::VectorHolder< T, REFV >::const_iterator_imp_specific::dc(), edm::detailsTrie::errorInsert(), edm::OwnArray< T, MAX_SIZE, P >::fillView(), edm::ServiceRegistry::get(), edm::serviceregistry::ServicesManager::get(), edm::AssociationMap< edm::OneToMany< reco::BasicJetCollection, reco::TrackCollection > >::get(), edm::Handle< GenericObject >::Handle(), edm::Handle< FWGenericObject >::Handle(), edm::OneToValue< reco::CaloJetCollection, reco::L2TauIsolationInfo >::insert(), edm::OneToMany< reco::TrackJetCollection, reco::TrackCollection >::insert(), edm::OneToOneGeneric< std::vector< TrackCandidate >, std::vector< Trajectory >, unsigned int >::insert(), edm::OneToManyWithQualityGeneric< std::vector< reco::Track >, std::vector< reco::Vertex >, int, unsigned int >::insert(), edm::ServiceRegistry::isAvailable(), edm::reftobase::RefProdKey::key(), edm::RefToBase< T >::key(), edm::makeRefTo(), edm::reftobase::InvalidHolderToVector< T, REF >::makeVectorHolder(), edm::reftobase::InvalidRefHolderToRefVector< REF >::makeVectorHolder(), edm::reftobase::RefVectorHolderBase::const_iterator::operator*(), edm::reftobase::RefVectorHolderBase::const_iterator::operator+(), edm::reftobase::RefVectorHolderBase::const_iterator::operator++(), edm::reftobase::RefVectorHolderBase::const_iterator::operator+=(), edm::reftobase::RefVectorHolderBase::const_iterator::operator-(), edm::reftobase::RefVectorHolderBase::const_iterator::operator--(), edm::reftobase::RefVectorHolderBase::const_iterator::operator-=(), edm::RefToBaseProd< T >::operator->(), edm::reftobase::RefVectorHolderBase::const_iterator::operator<(), edm::reftobase::RefVectorHolder< REFV >::push_back(), edm::reftobase::IndirectVectorHolder< reco::Candidate >::push_back(), edm::reftobase::VectorHolder< reco::Candidate, reco::GsfElectronRefVector >::push_back(), edm::detail::reallyfillPtrVector(), edm::detail::reallySetPtr(), edm::ESProducer::registerProduct(), edm::OwnVector< T, P >::swap(), edm::helper::Filler< Association< C > >::throwAdd(), edm::helper::Filler< Association< C > >::throwFillSize(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::throwIndexBound(), edm::Association< reco::FFTJPTJetCollection >::throwIndexMapBound(), edm::reftobase::BaseVectorHolder< T >::const_iterator::throwInvalidReference(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::throwNotExisting(), and edm::Association< reco::FFTJPTJetCollection >::throwRefSet().

108  {
109  Exception e(aCategory, std::string(message0));
110  e << message1 << message2 << message3 << message4;
111  throw e;
112  }
void Exception::throwThis ( Code  category,
char const *  message0,
int  intVal,
char const *  message2 = "" 
)
static

Definition at line 115 of file EDMException.cc.

References MillePedeFileConverter_cfg::e, and AlCaHLTBitMon_QueryRunRegistry::string.

115  {
116  Exception e(aCategory, std::string(message0));
117  e << intVal << message1;
118  throw e;
119  }

Member Data Documentation

Code edm::Exception::category_
private

Definition at line 116 of file EDMException.h.

Referenced by returnCode_().