Update "Can't find key BEGIN..." error message to include the module/service looking for the key
Would it be possible to add the information about which module/service is looking for the key causing this exception to be thrown?
It would make debugging the problem more transparent for average users.
#1 Updated by Christopher Green over 7 years ago
- Category set to Infrastructure
- Status changed from New to Assigned
- Assignee set to Christopher Green
The major problem here is that the
"Can't find ..." exception is being thrown at a very low level (in the fhicl package) which obviously has no knowledge of the context in which the parameter was requested.
In the case where the exception is likely to occur in the constructor of service or module, it should be possible to "trap and wrap" the exception and add the module or service context. It should also be possible to trap and wrap the exception with module type / label if thrown as a result of calling a standard module entry point like
analyze(). However, it is not possible to do the same thing for a service -- a constructor is likely the only place we can trap and wrap a service exception.
Regardless however, the extra information will be in the form of an exception wrapper, not a nicely-formatted simple exception.
Let me know if this is what you want. I've added Marc as a watcher so he can comment on the advisability (or lack thereof) of doing something like this, as he is more familiar with this part of the system than I am.