Commit f7afb7c4 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

[ConfigProjector] Improve error message.

parent bb68e67a
Pipeline #16100 passed with stage
in 9 minutes and 31 seconds
......@@ -305,7 +305,14 @@ namespace hpp {
ConfigurationIn_t config)
{
if (!solver_->rightHandSideFromConfig (nm, config)) {
throw std::runtime_error ("Function was not found in the solver.");
std::ostringstream os;
os << "Function \"" << nm->function().name()
<< "\" was not found in the solver. Solver contains (";
for (auto constraint : solver_->constraints()) {
os << "\"" << constraint->function().name() << "\",";
}
os << ").";
throw std::runtime_error (os.str().c_str());
}
}
......@@ -319,7 +326,13 @@ namespace hpp {
vectorIn_t rhs)
{
if (!solver_->rightHandSide (nm, rhs)) {
throw std::runtime_error ("Function was not found in the solver. This is probably because it is an explicit function and rhs is not supported for this type of function.");
std::ostringstream os;
os << "Function \"" << nm->function().name()
<< "\" was not found in the solver. Solver contains (";
for (auto constraint : solver_->constraints()) {
os << "\"" << constraint->function().name() << "\",";
}
os << ").";
}
}
......
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