Feature #12574

Have exceptions from get() report the full configuration key

Added by Gianluca Petrillo almost 5 years ago. Updated almost 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


The methods fhicl::ParameterSet::get(std::string key) throw an exception when key is not found.
The message in the exception precisely reports key.
This makes configuration errors in art context harder to interpret, since the exact context needs to be pulled together from different parts of the exception chain.

With FHiCL source information now available, it might be possible to render more friendly messages reporting the full key.
For example, physics.producers.myModule.algo1.radius instead of just radius.

I attach a simple example showing the problem. Its second exception is the one I would like to be more informative. (1.31 KB) Example of error messages from ParameterSet::get() Gianluca Petrillo, 05/09/2016 03:02 PM


#1 Updated by Kyle Knoepfel almost 5 years ago

  • Status changed from New to Feedback

The ParameterSet that is throwing the exception does not have the information re. the nesting. We have tried to report useful context whenever an exception is thrown. However, if there are specific cases where these can be improved, we would like to know. Note that if configuration validation is used, the information you request is readily available, even when an exception is thrown.

Please let us know if the ParameterSet validation does not meet your needs.

#2 Updated by Gianluca Petrillo almost 5 years ago

I suspect that, in the case I have in my hands, parameter validation is not an option.

The "might" in my report was meant as "it might or it might not", and now I learn it's the latter.
Feel free to mark the feature request as rejected.
We'll just have the service intercept these exceptions, which is fully acceptable.

#3 Updated by Kyle Knoepfel almost 5 years ago

  • Status changed from Feedback to Rejected

Rejected per user request.

Also available in: Atom PDF