Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:58

0001 #include "FWCore/Framework/interface/NoDataException.h"
0002 
0003 namespace edm {
0004   namespace eventsetup {
0005 
0006     NoDataExceptionBase::NoDataExceptionBase(const EventSetupRecordKey& iRecordKey,
0007                                              const DataKey& iDataKey,
0008                                              const char* category_name)
0009         : cms::Exception(category_name), record_(iRecordKey), dataKey_(iDataKey) {}
0010 
0011     NoDataExceptionBase::~NoDataExceptionBase() noexcept {}
0012 
0013     const DataKey& NoDataExceptionBase::dataKey() const { return dataKey_; }
0014 
0015     std::string NoDataExceptionBase::providerButNoDataMessage(const EventSetupRecordKey& iKey) {
0016       return std::string(" A provider for this data exists, but it's unable to deliver the data for this \"") +
0017              iKey.name() +
0018              "\" record.\n Perhaps no valid data exists for this IOV? Please check the data's interval of validity.\n";
0019     }
0020 
0021     std::string NoDataExceptionBase::noProxyMessage() {
0022       return std::string("Please add an ESSource or ESProducer to your job which can deliver this data.\n");
0023     }
0024 
0025     void NoDataExceptionBase::beginDataTypeMessage(std::string& oString) const {
0026       oString += std::string("No data of type \"");
0027     }
0028 
0029     void NoDataExceptionBase::endDataTypeMessage(std::string& oString) const {
0030       oString += "\" with label \"";
0031       oString += this->dataKey_.name().value();
0032       oString += "\" in record \"";
0033       oString += this->record_.name();
0034       oString += "\"";
0035     }
0036 
0037     void NoDataExceptionBase::constructMessage(const char* iClassName, const std::string& iExtraInfo) {
0038       std::string message;
0039       beginDataTypeMessage(message);
0040       message += iClassName;
0041       endDataTypeMessage(message);
0042       this->append(message + std::string("\n "));
0043       this->append(iExtraInfo);
0044     }
0045 
0046   }  // namespace eventsetup
0047 }  // namespace edm