Commit 5d94f72b authored by peastman's avatar peastman
Browse files

Merge pull request #585 from jchodera/informative-error-message

More informative error messages for Context::getParameter() and setParameter()
parents 9d9e2cf0 7548057c
......@@ -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