Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-12 04:16:28

0001 #include "FWCore/Framework/interface/NoProductResolverException.h"
0002 
0003 #include <cstring>
0004 
0005 namespace edm {
0006   namespace eventsetup {
0007 
0008     NoProductResolverException::NoProductResolverException(const EventSetupRecordKey& key,
0009                                                            const char* iClassName,
0010                                                            const char* productLabel,
0011                                                            bool moduleLabelDoesNotMatch)
0012         : cms::Exception("NoProductResolverException") {
0013       append("Cannot find EventSetup module to produce data of type \"");
0014       append(iClassName);
0015       append("\" in\nrecord \"");
0016       append(key.name());
0017       if (std::strncmp(productLabel, "@mayConsume", 11) == 0) {
0018         // I'd rather print out the product label here, but we don't know
0019         // it at this point for the "may consume" case.
0020         append("\", which is being consumed via a call to setMayConsume.\n");
0021       } else {
0022         append("\" with product label \"");
0023         append(productLabel);
0024         append("\".\n");
0025       }
0026       if (moduleLabelDoesNotMatch) {
0027         // We discussed adding the requested and preferred module label into
0028         // the following message. That information is not currently available
0029         // and it would require some extra memory resources to make it available.
0030         // Given how rarely this exception occurs and how little used the feature
0031         // of selecting module labels is, we decided that it was not worth the
0032         // the extra memory. It could be done and if something changes and we end
0033         // up debugging these errors in the future often, it might be worth adding
0034         // the extra info...
0035         append(
0036             "An ESSource or ESProducer is configured to produce this data, but the\n"
0037             "ESInputTag in the configuration also requires a specific module label.\n"
0038             "The preferred module to produce this data in the configuration has a\n"
0039             "different module label.\n");
0040         append(
0041             "Please ensure that there is an ESSource or ESProducer configured with\n"
0042             "the requested module label that both produces this data and is selected\n"
0043             "as the preferred provider for this data. If there is more than one such\n"
0044             "ESSource or ESProducer you may need to use an ESPrefer directive in the\n"
0045             "configuration.");
0046       } else {
0047         append("Please add an ESSource or ESProducer to your job which can deliver this data.\n");
0048       }
0049     }
0050   }  // namespace eventsetup
0051 }  // namespace edm