CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
cms::Exception Class Reference

#include <Exception.h>

Inheritance diagram for cms::Exception:
Clustering1DException CMSexception cond::Exception DDException DetLayerException edm::CodedException< Code > edm::eventsetup::MakeDataException edm::eventsetup::NoDataExceptionBase edm::eventsetup::NoRecordException< T > edm::Exception edm::UnknownModuleException LinPtException MeasurementDetException ora::Exception popcon::Exception PropagationException RPCException StatisticsException StripClusterizerAlgorithm::InvalidChargeException TrajectoryStateException

Public Types

typedef std::string Category
 
typedef std::list< CategoryCategoryList
 

Public Member Functions

void append (Exception const &another)
 
void append (std::string const &more_information)
 
void append (char const *more_information)
 
std::string category () const
 
 Exception (Category const &category)
 
 Exception (Category const &category, std::string const &message)
 
 Exception (Category const &category, std::string const &message, Exception const &another)
 
 Exception (Exception const &other)
 
virtual std::string explainSelf () const
 
CategoryList const & history () const
 
void raise ()
 
std::string rootCause () const
 
virtual char const * what () const throw ()
 
virtual ~Exception () throw ()
 

Private Member Functions

virtual std::exception * clone () const
 
virtual void rethrow ()
 

Private Attributes

CategoryList category_
 
std::ostringstream ost_
 
std::string what_
 

Friends

template<typename E , typename T >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type
operator<< (E &e, T const &stuff)
 
template<typename E , typename T >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type const & 
operator<< (E const &e, T const &stuff)
 
template<typename E >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type
operator<< (E &e, std::ostream &(*f)(std::ostream &))
 
template<typename E >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type const & 
operator<< (E const &e, std::ostream &(*f)(std::ostream &))
 
template<typename E >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type
operator<< (E &e, std::ios_base &(*f)(std::ios_base &))
 
template<typename E >
detail::Desired< E,
detail::is_derived_or_same
< Exception, E >::value >
::type const & 
operator<< (E const &e, std::ios_base &(*f)(std::ios_base &))
 

Detailed Description

Definition at line 104 of file Exception.h.

Member Typedef Documentation

typedef std::string cms::Exception::Category

Definition at line 106 of file Exception.h.

Definition at line 107 of file Exception.h.

Constructor & Destructor Documentation

Exception::Exception ( Category const &  category)
explicit

Definition at line 6 of file Exception.cc.

Referenced by clone().

6  :
8  ost_(),
9  category_(1, aCategory),
10  what_()
11  {
12  }
std::ostringstream ost_
Definition: Exception.h:209
CategoryList category_
Definition: Exception.h:210
std::string what_
Definition: Exception.h:211
Exception::Exception ( Category const &  category,
std::string const &  message 
)

Definition at line 14 of file Exception.cc.

References argparse::message, and ost_.

15  :
17  ost_(),
18  category_(1, aCategory),
19  what_()
20  {
21  ost_ << message;
22  if(!message.empty()) {
23  unsigned sz = message.size()-1;
24  if(message[sz]!='\n' && message[sz]!=' ') ost_ << " ";
25  }
26  }
std::ostringstream ost_
Definition: Exception.h:209
string message
Definition: argparse.py:126
CategoryList category_
Definition: Exception.h:210
std::string what_
Definition: Exception.h:211
Exception::Exception ( Category const &  category,
std::string const &  message,
Exception const &  another 
)

Definition at line 28 of file Exception.cc.

References append(), category(), category_, argparse::message, and ost_.

30  :
32  ost_(),
33  category_(1, aCategory),
34  what_()
35  {
36  ost_ << message;
37  // check for newline at end of message first
38  if(!message.empty() && message[message.size()-1]!='\n')
39  ost_ << "\n";
40  category_.push_back(another.category());
41  append(another);
42  }
void append(Exception const &another)
Definition: Exception.cc:82
std::ostringstream ost_
Definition: Exception.h:209
string message
Definition: argparse.py:126
CategoryList category_
Definition: Exception.h:210
std::string what_
Definition: Exception.h:211
Exception::Exception ( Exception const &  other)

Definition at line 44 of file Exception.cc.

References ost_.

44  :
46  ost_(),
47  category_(other.category_),
48  what_(other.what_)
49  {
50  ost_ << other.ost_.str();
51  }
std::ostringstream ost_
Definition: Exception.h:209
CategoryList category_
Definition: Exception.h:210
std::string what_
Definition: Exception.h:211
Exception::~Exception ( )
throw (
)
virtual

Reimplemented in edm::Exception, ora::Exception, cond::Exception, and popcon::Exception.

Definition at line 53 of file Exception.cc.

53  {
54  }

Member Function Documentation

void Exception::append ( Exception const &  another)
void Exception::append ( std::string const &  more_information)

Definition at line 86 of file Exception.cc.

References ost_.

Referenced by hltFindDuplicates.ModuleList::__init__(), and hltFindDuplicates.ModuleList::extend().

86  {
87  ost_ << more_information;
88  }
std::ostringstream ost_
Definition: Exception.h:209
void Exception::append ( char const *  more_information)

Definition at line 90 of file Exception.cc.

References ost_.

Referenced by hltFindDuplicates.ModuleList::__init__(), and hltFindDuplicates.ModuleList::extend().

90  {
91  ost_ << more_information;
92  }
std::ostringstream ost_
Definition: Exception.h:209
std::string Exception::category ( ) const
std::exception * Exception::clone ( void  ) const
privatevirtual

Reimplemented in Genexception, BaseGenexception, and Fastexception.

Definition at line 102 of file Exception.cc.

References Exception().

102  {
103  return new Exception(*this);
104  }
Exception(Category const &category)
Definition: Exception.cc:6
std::string Exception::explainSelf ( void  ) const
virtual

Reimplemented in Fastexception, and CMSexception.

Definition at line 56 of file Exception.cc.

References category(), and ost_.

Referenced by append(), edm::EventProcessor::asyncRun(), ConvertedPhotonProducer::buildCollections(), StorageFactory::check(), evf::FUEventProcessor::configuring(), evf::FUEventProcessor::enableCommon(), DTVDriftWriter::endJob(), DTTTrigCorrection::endJob(), edm::Schedule::endJob(), edm::roottree::getEntry(), smproxy::SMProxyServer::handleFSMSoapMessage(), stor::StorageManager::handleFSMSoapMessage(), evf::FWEPWrapper::init(), edm::RootInputFileSequence::initFile(), edm::StreamerInputFile::openStreamerFile(), cms::operator<<(), edm::printCmsException(), CachedTrajectory::propagate(), edm::StreamerInputFile::readBytes(), ConversionVertexFinder::run(), edm::StreamerInputFile::skipBytes(), StorageFactory::stagein(), evf::FWEPWrapper::stop(), TrajectoryStateClosestToPoint::TrajectoryStateClosestToPoint(), MuonUpdatorAtVertex::update(), what(), edm::EventProcessor::~EventProcessor(), statemachine::HandleLumis::~HandleLumis(), and statemachine::HandleRuns::~HandleRuns().

56  {
57  std::ostringstream ost;
58  std::string part(ost_.str());
59  // Remove any trailing newline
60 
61  ost << "---- " << category() << " BEGIN\n"
62  << part;
63 
64  if(!part.empty() && part[part.size()-1]!='\n') ost << "\n";
65  ost << "---- " << category() << " END\n";
66 
67  return ost.str();
68  }
std::ostringstream ost_
Definition: Exception.h:209
part
Definition: HCALResponse.h:21
std::string category() const
Definition: Exception.cc:74
Exception::CategoryList const & Exception::history ( ) const

Definition at line 70 of file Exception.cc.

References category_.

Referenced by cms::TrackListMerger::produce().

70  {
71  return category_;
72  }
CategoryList category_
Definition: Exception.h:210
void cms::Exception::raise ( )
inline
void Exception::rethrow ( void  )
privatevirtual

Reimplemented in edm::Exception, Genexception, BaseGenexception, and Fastexception.

Definition at line 106 of file Exception.cc.

Referenced by raise().

106  {
107  throw *this;
108  }
std::string Exception::rootCause ( ) const
char const * Exception::what ( ) const
throw (
)
virtual

Reimplemented in BaseGenexception, Fastexception, and CMSexception.

Definition at line 97 of file Exception.cc.

References explainSelf(), and what_.

Referenced by AdaptiveVertexReconstructor::AdaptiveVertexReconstructor(), MeasurementTracker::addStripDet(), SiStripDetVOffFakeBuilder::analyze(), MultiTrackValidator::analyze(), SiPixelLorentzAngleDB::analyze(), AlcaBeamMonitor::analyze(), L1CondDBPayloadWriter::analyze(), sistrip::SpyIdentifyRunsModule::analyze(), SiStripSpyMonitorModule::analyze(), PrimaryVertexValidation::analyze(), MuonTrackValidator::analyze(), evf::FUEventProcessor::attachDqmToShm(), AlcaBeamMonitor::beginLuminosityBlock(), GeometricSearchTrackerBuilder::build(), MagGeoBuilderFromDDD::buildInterpolator(), LocalCacheFile::cache(), CSCSectorReceiverLUT::calcGlobalPhiME(), edm::ExceptionCollector::call(), edm::service::MessageServicePSetValidation::check(), FWBeamSpot::checkBeamSpot(), PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create(), sistrip::SpyUnpacker::createDigis(), sistrip::RawToDigiUnpacker::createDigis(), evf::FUEventProcessor::detachDqmFromShm(), edm::EDLooperBase::doDuringLoop(), edm::Worker::doWork(), UncatchedException::dump(), FWModelChangeManager::endChanges(), edm::Schedule::endJob(), exceptionTranslation(), sistrip::RawToClustersLazyUnpacker::fill(), SiStripMonitorPedestals::fillCondDBMEs(), SiStripNoisesDQM::fillMEsForDet(), SiStripApvGainsDQM::fillMEsForDet(), SiStripPedestalsDQM::fillMEsForDet(), SiStripThresholdDQM::fillMEsForDet(), SiStripQualityDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForLayer(), SiStripLorentzAngleDQM::fillMEsForLayer(), SiStripPedestalsDQM::fillMEsForLayer(), SiStripThresholdDQM::fillMEsForLayer(), SiStripApvGainsDQM::fillMEsForLayer(), SiStripQualityDQM::fillMEsForLayer(), NuclearVertexBuilder::FillVertexWithAdaptVtxFitter(), LaserAlignmentEventFilter::filter(), TrackerOfflineValidationSummary::fitResiduals(), TrackerOfflineValidation::fitResiduals(), edm::EventProcessor::forkProcess(), CSCSectorReceiverLUT::getGlobalEtaValue(), CSCSectorReceiverLUT::getGlobalPhiValue(), HcalO2OManager::getListOfPoolIovs(), HcalO2OManager::getListOfPoolTags(), SiStripConfigDb::handleException(), edm::Path::handleWorkerFailure(), edm::MessageLoggerQ::handshakedCommand(), stor::EventStreamSelector::initialize(), stor::EventConsumerSelector::initialize(), SiPixelGainCalibrationForHLTService::isDead(), SiPixelGainCalibrationOfflineService::isDead(), SiPixelGainCalibrationService::isDead(), SiPixelGainCalibrationForHLTSimService::isDead(), SiPixelGainCalibrationOfflineSimService::isDead(), SiPixelGainCalibrationOfflineService::isDeadColumn(), SiPixelGainCalibrationForHLTService::isDeadColumn(), SiPixelGainCalibrationOfflineSimService::isDeadColumn(), SiPixelGainCalibrationForHLTSimService::isDeadColumn(), SiPixelGainCalibrationOfflineService::isNoisy(), SiPixelGainCalibrationForHLTService::isNoisy(), SiPixelGainCalibrationService::isNoisy(), SiPixelGainCalibrationOfflineSimService::isNoisy(), SiPixelGainCalibrationForHLTSimService::isNoisy(), SiPixelGainCalibrationOfflineService::isNoisyColumn(), SiPixelGainCalibrationForHLTService::isNoisyColumn(), SiPixelGainCalibrationOfflineSimService::isNoisyColumn(), SiPixelGainCalibrationForHLTSimService::isNoisyColumn(), main(), cond::BasePayloadProxy::make(), evf::FUEventProcessor::microState(), tfwliteselectortest::ThingsWorker::process(), tfwliteselectortest::ThingsTSelector::process(), cond::XMLAuthenticationService::XMLAuthenticationService::processFile(), edm::Schedule::processOneOccurrence(), CastorDigiToRaw::produce(), HcalDigiToRaw::produce(), HcalRawToDigi::produce(), CastorRawToDigi::produce(), CSCTFUnpacker::produce(), SoftElectronProducer::produce(), EcalDCCTBUnpackingModule::produce(), EcalDCCTB07UnpackingModule::produce(), sistrip::SpyEventSummaryProducer::produce(), sistrip::FEDEmulatorModule::produce(), edm::EventProcessor::readAndProcessEvent(), RecoProducerFP420::RecoProducerFP420(), sistrip::FEDEmulator::retrieveNoises(), sistrip::FEDEmulator::retrievePedestals(), cond::Utilities::run(), KalmanAlignmentAlgorithm::run(), edm::service::MessageLoggerScribe::runCommand(), FWPathsPopup::scheduleReloadEvent(), SiStripPedestalsSubtractor::subtract_(), and DTCalibDBUtils::writeToDB().

97  {
98  what_ = explainSelf();
99  return what_.c_str();
100  }
virtual std::string explainSelf() const
Definition: Exception.cc:56
std::string what_
Definition: Exception.h:211

Friends And Related Function Documentation

template<typename E , typename T >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type& operator<< ( E &  e,
T const &  stuff 
)
friend

Definition at line 228 of file Exception.h.

229  {
230  e.ost_ << stuff;
231  return e;
232  }
template<typename E , typename T >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type const& operator<< ( E const &  e,
T const &  stuff 
)
friend

Definition at line 237 of file Exception.h.

238  {
239  E& ref = const_cast<E&>(e);
240  ref.ost_ << stuff;
241  return e;
242  }
template<typename E >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type& operator<< ( E &  e,
std::ostream &(*)(std::ostream &)  f 
)
friend

Definition at line 247 of file Exception.h.

248  {
249  f(e.ost_);
250  return e;
251  }
double f[11][100]
template<typename E >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type const& operator<< ( E const &  e,
std::ostream &(*)(std::ostream &)  f 
)
friend

Definition at line 256 of file Exception.h.

257  {
258  E& ref = const_cast<E&>(e);
259  f(ref.ost_);
260  return e;
261  }
double f[11][100]
template<typename E >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type& operator<< ( E &  e,
std::ios_base &(*)(std::ios_base &)  f 
)
friend

Definition at line 266 of file Exception.h.

267  {
268  f(e.ost_);
269  return e;
270  }
double f[11][100]
template<typename E >
detail::Desired<E, detail::is_derived_or_same<Exception,E>::value>::type const& operator<< ( E const &  e,
std::ios_base &(*)(std::ios_base &)  f 
)
friend

Definition at line 276 of file Exception.h.

277  {
278  E& ref = const_cast<E&>(e);
279  f(ref.ost_);
280  return e;
281  }
double f[11][100]

Member Data Documentation

CategoryList cms::Exception::category_
private

Definition at line 210 of file Exception.h.

Referenced by category(), Exception(), history(), and rootCause().

std::ostringstream cms::Exception::ost_
private

Definition at line 209 of file Exception.h.

Referenced by append(), Exception(), and explainSelf().

std::string cms::Exception::what_
mutableprivate

Definition at line 211 of file Exception.h.

Referenced by what().