Open Iximiel opened 1 month ago
I agree the error msg is terrible. I tried a stupid input file with AA
on a single line.
With v2.9 the error is:
I cannot understand line: AA
Maybe a missing space or a typo?
which we deemed cryptic. Now it is
+++ assertion failed: m.count(key)>0
which I would argue is far worse.
Perhaps can be something like:
Action XXX is not known.
Plus, if XXX is in the ModuleMap:
An Action named XXX is available in module YYY. Please consider installing PLUMED with that module enabled.
ok, so the modifications could be
For the text I am going with your proposals
Now the output is:
PLUMED: ################################################################################
PLUMED:
PLUMED: Action "CONTACT_MATRIX" is not known.
PLUMED: An Action named "CONTACT_MATRIX" is available in module "adjmat".
PLUMED: Please consider installing PLUMED with that module enabled.
PLUMED: ################################################################################
When the missing action is in the moduleMap
or
PLUMED: ################################################################################
PLUMED:
PLUMED: Action "ASD" is not known.
PLUMED: ################################################################################
when the missing action is not in the moduleMap
I set up the exception also for the CLTool, for completion, since plumed notCL
will exit already with a clear error message
Description
I was running some tests on some previous commit (where regtest/clusters/rt-dfg1/config had a wrong module prerequisites instead of
plumed_modules="adjmat clusters"
) and the exception text+++ assertion failed: m.count(key)>0
felt not helpful.I think that the text
+++ assertion failed: m.count(key)>0, Missing key is "KEYNAME"
feel a little more helpful. I think these few lines may help at least in doing agit grep KEYNAME
in src or aplumed manual KEYNAME
to find at least which module has not been loaded.An maybe we can use #1063 for giving directly that info, I do not know if directly in the register or also in an ad-hoc cltool or in cltools/Manual.cpp
Target release
I would like my code to appear in release 2.10
Type of contribution
Copyright
COPYRIGHT
file with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulename
in order to make sure the headers of the module are correct.Tests