Project

General

Profile

Feature #2445

Feature #7538: art service/module command-line helpers

Feature #8770: Implement parameter set validation - task 3a of issue #7538

Request improved error message

Added by Rob Kutschke over 7 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Infrastructure
Target version:
Start date:
02/02/2012
Due date:
08/01/2015
% Done:

100%

Estimated time:
0.00 h
Scope:
Internal
Experiment:
-
SSI Package:
-
Duration: 1277

Description

I am writing a service that contains the following fragment called from its c'tor

  baseSeed_    = pSet.get<unsigned>("baseSeed");

where pSet is an fhicl::ParameterSet const& and where baseSeed_ is an unsigned.

If the parameter is absent in the .fcl file, I get the following message:

%MSG-s ArtException:  mu2e 02-Feb-2012 11:33:10 CST JobSetup
cet::exception caught in art
---- OtherArt BEGIN
  ServiceCreation
  ---- Can't find key BEGIN
    baseSeed
  ---- Can't find key END
  cet::exception caught during construction of service type mu2e::Seeds:
---- OtherArt ENDArt has completed and will exit with status
%MSG

The two important pieces of information are lost in the framing information. Is there any hope of improving this?

I can always improve the error message by:

   if ( !pSet.get_if_present("baseSeed",baseSeed_) ){
      throw cet::exception("SEEDS")
        << "SeedService: was unable to find the parameter baseSeed in the input parameter set.\n";
    }

but the code is much easier to read if I don't feel the need to do this.


Related issues

Has duplicate art - Feature #2664: Update "Can't find key BEGIN..." error message to include the module/service looking for the keyRejected

Has duplicate art - Bug #3134: Non-informative exception thrown if FHICL parameter isn't found in a Service constructorRejected2012-11-20

Precedes cet-is - Feature #9604: cetskelgen should be extended to deal with modified constructors for FHiCL validation.Accepted2015-08-032015-08-03

History

#1 Updated by Christopher Green almost 6 years ago

  • Description updated (diff)
  • Due date set to 09/30/2013
  • Category set to Infrastructure
  • Status changed from New to Accepted
  • Target version set to 1.09.00
  • Estimated time set to 24.00 h
  • Scope set to Internal
  • Experiment - added
  • SSI Package - added

#2 Updated by Christopher Green over 5 years ago

  • Target version changed from 1.09.00 to 521

#3 Updated by Kyle Knoepfel about 4 years ago

  • Target version changed from 521 to 1.18.00

#4 Updated by Christopher Green about 4 years ago

  • Due date changed from 09/30/2013 to 08/01/2015

#5 Updated by Marc Paterno about 4 years ago

  • Estimated time changed from 24.00 h to 0.00 h
  • Parent task set to #8770

This issue will be solved when the ParameterSet validation is handled.

#6 Updated by Kyle Knoepfel about 4 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

ParameterSet validation is now enabled for user/experiment-supplied modules and services, resolving the issue here. To enable the validation, the following changes are required for the constructors of the plugins

EDProducer

- MyProducer( fhicl::ParameterSet const& pset );
+ MyProducer( art::EDProducer::Table<MyConfig> const& config );

EDFilter

- MyFilter( fhicl::ParameterSet const& pset );
+ MyFilter( art::EDFilter::Table<MyConfig> const& config );

EDAnalyzer

- MyAnalyzer( fhicl::ParameterSet const& pset );
+ MyAnalyzer( art::EDAnalyzer::Table<MyConfig> const& config );

Services

- MyService( fhicl::ParameterSet const& pset, ActivityRegistry & );
+ MyService( art::ServiceTable<MyConfig> const& config, ActivityRegistry & );

Configuration exceptions (related to ParameterSet validation) are aggregated for all modules and printed to stdout with relevant contextual information (module label and module type). Exceptions for services happen one at a time (no aggregation). More details will be provided in the wiki documentation.

Implemented with merge art:15c863432754e457adf708d687f0de8d865aeed4.

#7 Updated by Christopher Green about 4 years ago

  • Related to Feature #9604: cetskelgen should be extended to deal with modified constructors for FHiCL validation. added

#8 Updated by Christopher Green about 4 years ago

  • Related to deleted (Feature #9604: cetskelgen should be extended to deal with modified constructors for FHiCL validation.)

#9 Updated by Christopher Green about 4 years ago

  • Precedes Feature #9604: cetskelgen should be extended to deal with modified constructors for FHiCL validation. added

#10 Updated by Kyle Knoepfel almost 4 years ago

  • Target version changed from 1.18.00 to 1.16.00

#11 Updated by Christopher Green almost 4 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF