Commit 7548057c authored by John Chodera (MSKCC)'s avatar John Chodera (MSKCC)
Browse files

Updated Context::getParameter() and Context::setParameter() error messages to...

Updated Context::getParameter() and Context::setParameter() error messages to also print name of incorrect parameter to aid debugging.
parent 9d9e2cf0
......@@ -217,13 +217,13 @@ const std::map<std::string, double>& ContextImpl::getParameters() const {
double ContextImpl::getParameter(std::string name) {
if (parameters.find(name) == parameters.end())
throw OpenMMException("Called getParameter() with invalid parameter name");
throw OpenMMException("Called getParameter() with invalid parameter name: "+name);
return parameters[name];
}
void ContextImpl::setParameter(std::string name, double value) {
if (parameters.find(name) == parameters.end())
throw OpenMMException("Called setParameter() with invalid parameter name");
throw OpenMMException("Called setParameter() with invalid parameter name: "+name);
parameters[name] = value;
integrator.stateChanged(State::Parameters);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment