00001 #include <FWCore/Framework/interface/NoDataException.h> 00002 00003 namespace edm { 00004 namespace eventsetup { 00005 00006 NoDataExceptionBase::NoDataExceptionBase(const EventSetupRecordKey& iRecordKey, 00007 const DataKey& iDataKey, 00008 const char* category_name) : 00009 cms::Exception(category_name), 00010 record_(iRecordKey), 00011 dataKey_(iDataKey) 00012 { 00013 } 00014 00015 NoDataExceptionBase::~NoDataExceptionBase() throw() {} 00016 00017 const DataKey& NoDataExceptionBase::dataKey() const { return dataKey_; } 00018 00019 std::string NoDataExceptionBase::providerButNoDataMessage(const EventSetupRecordKey& iKey) { 00020 return std::string(" A provider for this data exists, but it's unable to deliver the data for this \"") 00021 +iKey.name() 00022 +"\" record.\n Perhaps no valid data exists for this IOV? Please check the data's interval of validity.\n"; 00023 } 00024 00025 std::string NoDataExceptionBase::noProxyMessage() { 00026 return std::string("Please add an ESSource or ESProducer to your job which can deliver this data.\n"); 00027 } 00028 00029 void NoDataExceptionBase::beginDataTypeMessage(std::string& oString) const 00030 { 00031 oString+= std::string("No data of type \""); 00032 } 00033 00034 void NoDataExceptionBase::endDataTypeMessage(std::string& oString) const 00035 { 00036 oString += "\" with label \""; 00037 oString += this->dataKey_.name().value(); 00038 oString += "\" in record \""; 00039 oString += this->record_.name(); 00040 oString += "\""; 00041 } 00042 00043 void NoDataExceptionBase::constructMessage(const char* iClassName, const std::string& iExtraInfo) 00044 { 00045 std::string message; 00046 beginDataTypeMessage(message); 00047 message += iClassName; 00048 endDataTypeMessage(message); 00049 this->append(message+std::string("\n ")); 00050 this->append(iExtraInfo); 00051 } 00052 00053 } 00054 }